From a6b0a2226c8955977c3405586cc043cdc7f9f194 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 20 Jan 2022 15:16:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.dev.js | 1 + build.prod.js | 1 + src/base/col.wc | 34 +++++++++++++++++ src/base/row.wc | 92 +++++++++++++++++++++++++++++++++++++++++++++ src/editor/index.wc | 12 ++---- src/index.js | 2 + src/scroll/index.wc | 63 +++++++++++++++++-------------- 7 files changed, 169 insertions(+), 36 deletions(-) create mode 100644 src/base/col.wc create mode 100644 src/base/row.wc diff --git a/build.dev.js b/build.dev.js index 608db03..1be0801 100644 --- a/build.dev.js +++ b/build.dev.js @@ -21,6 +21,7 @@ const ESBUILD_OPTIONS = { format: 'esm' } const BASE_SCSS = ` +@use "sass:math"; * { box-sizing: border-box; margin: 0;padding: 0; diff --git a/build.prod.js b/build.prod.js index 6aeb47b..967df9b 100644 --- a/build.prod.js +++ b/build.prod.js @@ -21,6 +21,7 @@ const ESBUILD_OPTIONS = { minify: true } const BASE_SCSS = ` +@use "sass:math"; * { box-sizing: border-box; margin: 0;padding: 0; diff --git a/src/base/col.wc b/src/base/col.wc new file mode 100644 index 0000000..187e0e7 --- /dev/null +++ b/src/base/col.wc @@ -0,0 +1,34 @@ + + + + + diff --git a/src/base/row.wc b/src/base/row.wc new file mode 100644 index 0000000..7f7e221 --- /dev/null +++ b/src/base/row.wc @@ -0,0 +1,92 @@ + + + + + diff --git a/src/editor/index.wc b/src/editor/index.wc index 15a292a..6bee0bc 100644 --- a/src/editor/index.wc +++ b/src/editor/index.wc @@ -80,6 +80,7 @@ a { flex: 1; display: flex; flex-direction: column; + width: 100%; border: 1px solid #e7e8eb; border-radius: inherit; font-size: 14px; @@ -126,6 +127,7 @@ wc-scroll { flex: 1; } .editor { + width: 100%; height: 100%; padding: 5px 8px; outline: none; @@ -575,14 +577,8 @@ export default class Editor { .replace(/\t/g, ' ') .replace(/<\/?(meta|link|script)[^>]*?>/g, '') .replace(//g, '') - .replace( - /]*? href\s?=\s?["']?([^"']*)["']?[^>]*?>/g, - '' - ) - .replace( - /]*? src\s?=\s?["']?([^"']*)["']?[^>]*?>/g, - '' - ) + .replace(/]*? href\s?=\s?["']?([^"']*)["']?[^>]*?>/g, '') + .replace(/]*? src\s?=\s?["']?([^"']*)["']?[^>]*?>/g, '') .replace(/<(?!a|img)([\w\-]+)[^>]*>/g, '<$1>') .replace(/]*?>[\w\W]*?<\/xml>/g, '') .replace(/