@qxs-bns/components-wc 0.0.30 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/editor/blocksuite-editor.mjs +166 -357
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/editor/toolbar.mjs +2 -0
- package/es/editor/toolbar.mjs.map +1 -0
- package/es/subject/action.mjs +7 -8
- package/es/subject/action.mjs.map +1 -1
- package/es/subject/blank-fill.mjs +243 -132
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/layout.mjs +4 -4
- package/es/subject/layout.mjs.map +1 -1
- package/es/subject/page-end.mjs +1 -1
- package/es/subject/page-end.mjs.map +1 -1
- package/es/subject/scale.mjs +165 -126
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/shared-methods.mjs +2 -0
- package/es/subject/shared-methods.mjs.map +1 -0
- package/es/subject/shared-styles.mjs +75 -0
- package/es/subject/shared-styles.mjs.map +1 -0
- package/es/subject/single.mjs +243 -187
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/sortable.mjs +7 -7
- package/es/subject/sortable.mjs.map +1 -1
- package/es/subject/text-fill.mjs +273 -138
- package/es/subject/text-fill.mjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +166 -357
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/editor/toolbar.cjs +2 -0
- package/lib/editor/toolbar.cjs.map +1 -0
- package/lib/subject/action.cjs +33 -34
- package/lib/subject/action.cjs.map +1 -1
- package/lib/subject/blank-fill.cjs +247 -136
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/layout.cjs +2 -2
- package/lib/subject/layout.cjs.map +1 -1
- package/lib/subject/page-end.cjs +2 -2
- package/lib/subject/page-end.cjs.map +1 -1
- package/lib/subject/scale.cjs +165 -126
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/shared-methods.cjs +2 -0
- package/lib/subject/shared-methods.cjs.map +1 -0
- package/lib/subject/shared-styles.cjs +75 -0
- package/lib/subject/shared-styles.cjs.map +1 -0
- package/lib/subject/single.cjs +243 -187
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/sortable.cjs +1 -1
- package/lib/subject/sortable.cjs.map +1 -1
- package/lib/subject/text-fill.cjs +273 -138
- package/lib/subject/text-fill.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-methods.cjs","sources":["../../../../packages/components-wc/src/subject/shared-methods.ts"],"sourcesContent":["import { joinSubjectTitle, resolveSubjectPrefix } from './title-prefix'\n\nexport function emitSubjectEvent(host: EventTarget, name: string, detail?: unknown) {\n host.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n}\n\nexport function emitSubjectModelValue(host: EventTarget, value: string) {\n host.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: value,\n }))\n}\n\nexport function showSubjectToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed',\n top: '20px',\n left: '50%',\n transform: 'translateX(-50%)',\n padding: '10px 20px',\n borderRadius: '4px',\n fontSize: '13px',\n color: '#fff',\n background: '#f56c6c',\n zIndex: '99999',\n boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s',\n opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => {\n el.style.opacity = '0'\n setTimeout(() => el.remove(), 300)\n }, 2500)\n}\n\nexport function getSubjectImageResources(resourceList: any[] = []) {\n return resourceList\n .filter(item => item?.resourceType === 1)\n .map(item => item?.resource?.middle || item?.resource?.url)\n .filter(Boolean) as string[]\n}\n\nexport function getSubjectVideoResource(resourceList: any[] = []) {\n return resourceList.find(item => item?.resourceType === 2)?.resource || null\n}\n\nexport function resolveSubjectCategoryLabel(categoryList: any[] = [], categoryId?: string | number) {\n const matched = categoryList.find((item: any) => String(item?.categoryId) === String(categoryId))\n return matched?.title || matched?.categoryName || categoryId || '未选择分类'\n}\n\nexport function buildSubjectPreviewTitle(subjectPrefix: unknown, orderIndex: number, title: string) {\n return joinSubjectTitle(\n resolveSubjectPrefix(subjectPrefix, `${orderIndex + 1}.`),\n title,\n )\n}\n\nexport function buildSubjectSortingTitle(subjectPrefix: unknown, orderIndex: number, title: string) {\n return joinSubjectTitle(\n resolveSubjectPrefix(subjectPrefix, `${orderIndex + 1}. `),\n title,\n )\n}\n"],"names":["subjectPrefix","orderIndex","title","joinSubjectTitle","resolveSubjectPrefix","host","name","detail","dispatchEvent","CustomEvent","bubbles","composed","value","arguments","length","undefined","filter","item","resourceType","map","resource","middle","url","Boolean","resourceList","find","categoryId","matched","String","categoryName","msg","el","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove"],"mappings":"kFAuDO,SAAkCA,EAAwBC,EAAoBC,GACnF,OAAOC,EAAAA,iBACLC,uBAAqBJ,EAAe,GAAGC,EAAa,MACpDC,EAEJ,mCAEO,SAAkCF,EAAwBC,EAAoBC,GACnF,OAAOC,EAAAA,iBACLC,uBAAqBJ,EAAe,GAAGC,EAAa,OACpDC,EAEJ,2BAjEO,SAA0BG,EAAmBC,EAAcC,GAChEF,EAAKG,cAAc,IAAIC,YAAYH,EAAM,CAAEI,SAAS,EAAMC,UAAU,EAAMJ,OAAQA,GAAU,OAC9F,gCAEO,SAA+BF,EAAmBO,GACvDP,EAAKG,cAAc,IAAIC,YAAY,oBAAqB,CACtDC,SAAS,EACTC,UAAU,EACVJ,OAAQK,IAEZ,mCA2BO,WACL,OADuCC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAsB,IAE1DG,OAAOC,GAA+B,IAAvBA,GAAMC,cACrBC,IAAIF,GAAQA,GAAMG,UAAUC,QAAUJ,GAAMG,UAAUE,KACtDN,OAAOO,QACZ,kCAEO,WAA2D,IAA1BC,EAAAX,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAsB,GAC5D,OAAOW,EAAaC,KAAKR,GAA+B,IAAvBA,GAAMC,eAAqBE,UAAY,IAC1E,sCAEO,WAA6F,IAA9BM,EAAAb,UAAAC,OAAA,EAAAD,kBAAAE,EACpE,MAAMY,GADoCd,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAsB,IACnCY,KAAMR,GAAcW,OAAOX,GAAMS,cAAgBE,OAAOF,IACrF,OAAOC,GAASzB,OAASyB,GAASE,cAAgBH,GAAc,OAClE,2BAvCO,SAA0BI,GAC/B,MAAMC,EAAKC,SAASC,cAAc,OAClCF,EAAGG,YAAcJ,EACjBK,OAAOC,OAAOL,EAAGM,MAAO,CACtBC,SAAU,QACVC,IAAK,OACLC,KAAM,MACNC,UAAW,mBACXC,QAAS,YACTC,aAAc,MACdC,SAAU,OACVC,MAAO,OACPC,WAAY,UACZC,OAAQ,QACRC,UAAW,6BACXC,WAAY,cACZC,QAAS,MAEXlB,SAASmB,KAAKC,YAAYrB,GAC1BsB,WAAW,KACTtB,EAAGM,MAAMa,QAAU,IACnBG,WAAW,IAAMtB,EAAGuB,SAAU,MAC7B,KACL"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";var e=require("lit");const t=e.css`
|
|
2
|
+
*, ::before, ::after { box-sizing: border-box; }
|
|
3
|
+
input[type="radio"], input[type="checkbox"] { margin: 0; }
|
|
4
|
+
`,i=e.css`
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
font-family: inherit;
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
color: #5a5a5a;
|
|
10
|
+
}
|
|
11
|
+
`,o=e.css`
|
|
12
|
+
.preview { padding: 10px 0 4px; }
|
|
13
|
+
.preview-header { display: flex; flex-direction: column; gap: 12px; }
|
|
14
|
+
.preview-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
|
|
15
|
+
.preview .title { font-size: 16px; line-height: 1.75; font-weight: 600; color: #303133; }
|
|
16
|
+
.preview-type { font-size: 12px; line-height: 1.4; font-weight: 600; color: #8b95a7; letter-spacing: 0.02em; }
|
|
17
|
+
.preview .rich-text { font-size: 14px; line-height: 1.8; color: #4b5563; }
|
|
18
|
+
.preview .rich-text p { margin: 0; }
|
|
19
|
+
.preview .rich-text p + p { margin-top: 0.75em; }
|
|
20
|
+
.preview .rich-text img { max-width: 100%; }
|
|
21
|
+
.preview .rich-text img[data-align="left"] { display: block !important; margin: 0 auto 0 0 !important; }
|
|
22
|
+
.preview .rich-text img[data-align="center"] { display: block !important; margin: 0 auto !important; }
|
|
23
|
+
.preview .rich-text img[data-align="right"] { display: block !important; margin: 0 0 0 auto !important; }
|
|
24
|
+
.preview-section { margin-top: 18px; }
|
|
25
|
+
.preview-section-label { font-size: 12px; line-height: 1.4; font-weight: 600; color: #8b95a7; }
|
|
26
|
+
.preview-section-body { margin-top: 8px; }
|
|
27
|
+
`,r=e.css`
|
|
28
|
+
.label { min-width: 72px; font-size: 12px; line-height: 1.4; font-weight: 600; color: #8b95a7; letter-spacing: 0.02em; }
|
|
29
|
+
|
|
30
|
+
.edit-form { display: flex; flex-direction: column; gap: 16px; }
|
|
31
|
+
.edit-row,
|
|
32
|
+
.section-row {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: flex-start;
|
|
35
|
+
gap: 16px;
|
|
36
|
+
margin-top: 0;
|
|
37
|
+
}
|
|
38
|
+
.edit-row > .label,
|
|
39
|
+
.section-row > .label {
|
|
40
|
+
padding-top: 8px;
|
|
41
|
+
}
|
|
42
|
+
.row-body {
|
|
43
|
+
flex: 1;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
}
|
|
46
|
+
`,p=e.css`
|
|
47
|
+
textarea {
|
|
48
|
+
border: 1px solid #dcdfe6;
|
|
49
|
+
border-radius: 6px;
|
|
50
|
+
padding: 7px 11px;
|
|
51
|
+
font-size: 13px;
|
|
52
|
+
font-family: inherit;
|
|
53
|
+
width: 100%;
|
|
54
|
+
resize: none;
|
|
55
|
+
transition: border-color .2s;
|
|
56
|
+
line-height: 1.5;
|
|
57
|
+
display: block;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
}
|
|
60
|
+
textarea:focus { border-color: #3D61E3; outline: none; }
|
|
61
|
+
textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
|
|
62
|
+
|
|
63
|
+
.el-input { position: relative; display: block; }
|
|
64
|
+
.el-input textarea { padding-bottom: 24px; }
|
|
65
|
+
.el-input .char-counter {
|
|
66
|
+
position: absolute;
|
|
67
|
+
right: 12px;
|
|
68
|
+
bottom: 8px;
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
color: #909399;
|
|
71
|
+
line-height: 1;
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
}
|
|
74
|
+
`;exports.subjectControlResetStyles=t,exports.subjectFormBaseStyles=r,exports.subjectHostStyles=i,exports.subjectPreviewBaseStyles=o,exports.subjectTextareaStyles=p;
|
|
75
|
+
//# sourceMappingURL=shared-styles.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-styles.cjs","sources":["../../../../packages/components-wc/src/subject/shared-styles.ts"],"sourcesContent":["import { css } from 'lit'\n\nexport const subjectControlResetStyles = css`\n *, ::before, ::after { box-sizing: border-box; }\n input[type=\"radio\"], input[type=\"checkbox\"] { margin: 0; }\n`\n\nexport const subjectHostStyles = css`\n :host {\n display: block;\n font-family: inherit;\n font-size: 12px;\n color: #5a5a5a;\n }\n`\n\nexport const subjectPreviewBaseStyles = css`\n .preview { padding: 10px 0 4px; }\n .preview-header { display: flex; flex-direction: column; gap: 12px; }\n .preview-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }\n .preview .title { font-size: 16px; line-height: 1.75; font-weight: 600; color: #303133; }\n .preview-type { font-size: 12px; line-height: 1.4; font-weight: 600; color: #8b95a7; letter-spacing: 0.02em; }\n .preview .rich-text { font-size: 14px; line-height: 1.8; color: #4b5563; }\n .preview .rich-text p { margin: 0; }\n .preview .rich-text p + p { margin-top: 0.75em; }\n .preview .rich-text img { max-width: 100%; }\n .preview .rich-text img[data-align=\"left\"] { display: block !important; margin: 0 auto 0 0 !important; }\n .preview .rich-text img[data-align=\"center\"] { display: block !important; margin: 0 auto !important; }\n .preview .rich-text img[data-align=\"right\"] { display: block !important; margin: 0 0 0 auto !important; }\n .preview-section { margin-top: 18px; }\n .preview-section-label { font-size: 12px; line-height: 1.4; font-weight: 600; color: #8b95a7; }\n .preview-section-body { margin-top: 8px; }\n`\n\nexport const subjectFormBaseStyles = css`\n .label { min-width: 72px; font-size: 12px; line-height: 1.4; font-weight: 600; color: #8b95a7; letter-spacing: 0.02em; }\n\n .edit-form { display: flex; flex-direction: column; gap: 16px; }\n .edit-row,\n .section-row {\n display: flex;\n align-items: flex-start;\n gap: 16px;\n margin-top: 0;\n }\n .edit-row > .label,\n .section-row > .label {\n padding-top: 8px;\n }\n .row-body {\n flex: 1;\n min-width: 0;\n }\n`\n\nexport const subjectTextareaStyles = css`\n textarea {\n border: 1px solid #dcdfe6;\n border-radius: 6px;\n padding: 7px 11px;\n font-size: 13px;\n font-family: inherit;\n width: 100%;\n resize: none;\n transition: border-color .2s;\n line-height: 1.5;\n display: block;\n box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute;\n right: 12px;\n bottom: 8px;\n font-size: 12px;\n color: #909399;\n line-height: 1;\n pointer-events: none;\n }\n`\n"],"names":["subjectControlResetStyles","css","subjectHostStyles","subjectPreviewBaseStyles","subjectFormBaseStyles","subjectTextareaStyles"],"mappings":"kCAEO,MAAMA,EAA4BC,EAAAA,GAAA;;;EAK5BC,EAAoBD,EAAAA,GAAA;;;;;;;EASpBE,EAA2BF,EAAAA,GAAA;;;;;;;;;;;;;;;;EAkB3BG,EAAwBH,EAAAA,GAAA;;;;;;;;;;;;;;;;;;;EAqBxBI,EAAwBJ,EAAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|