@4399ywkf/design 1.3.4 → 1.3.6

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.
@@ -0,0 +1 @@
1
+ .dumi-btn{font-size:14px;height:32px;padding:4px 15px;border-radius:6px;transition:all .3s;cursor:pointer}.dumi-btn-default{background:#fff;color:#333;border:1px solid #d9d9d9}.dumi-btn-default:hover{color:#4d90fe;border-color:#4d90fe}.dumi-btn-primary{color:#fff;background:#4d90fe;border:1px solid #4d90fe}
@@ -0,0 +1 @@
1
+ .image-editor{display:flex;flex-direction:column;gap:1rem;align-items:center;height:100%;width:100%}.image-editor .canvas-container{position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;min-width:250px;min-height:250px;padding:20px;overflow:hidden}.image-editor .canvas-container .canvas-wrapper::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(45deg,#f0f0f0 25%,transparent 25%),linear-gradient(-45deg,#f0f0f0 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#f0f0f0 75%),linear-gradient(-45deg,transparent 75%,#f0f0f0 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0;z-index:0}.image-editor .canvas-container .canvas-wrapper canvas{position:relative;border:none;display:block;z-index:1}.image-editor .canvas-container .canvas-wrapper .resize-edge{position:absolute;background:#666}.image-editor .canvas-container .canvas-wrapper .resize-edge.left,.image-editor .canvas-container .canvas-wrapper .resize-edge.right{width:12px;height:80px;cursor:ew-resize;top:50%;transform:translateY(-50%)}.image-editor .canvas-container .canvas-wrapper .resize-edge.bottom,.image-editor .canvas-container .canvas-wrapper .resize-edge.top{width:80px;height:12px;cursor:ns-resize;left:50%;transform:translateX(-50%)}.image-editor .canvas-container .canvas-wrapper .resize-edge.left{left:-6px}.image-editor .canvas-container .canvas-wrapper .resize-edge.right{right:-6px}.image-editor .canvas-container .canvas-wrapper .resize-edge.top{top:-6px}.image-editor .canvas-container .canvas-wrapper .resize-edge.bottom{bottom:-6px}.image-editor .canvas-container .canvas-wrapper .resize-edge:hover{background:#333}.image-editor .toolbar{width:100%;display:flex;justify-content:center;gap:.5rem;padding:1rem;background:#f5f5f5;border-radius:4px}.tool-btn{display:flex;align-items:center;gap:.25rem;padding:.5rem 1rem;border:none;border-radius:4px;background:#fff;cursor:pointer;transition:all .2s}.tool-btn:hover{background:#e9e9e9}.tool-btn.active{background:#007bff;color:#fff}canvas{border:1px solid #ccc;border-radius:4px}
@@ -0,0 +1 @@
1
+ .code-header{display:flex;padding-top:.5rem;padding-bottom:.5rem;padding-inline-start:1.25rem;padding-inline-end:1.25rem;background:#7a6651;color:#ffff;border-color:#e2e8f0}
@@ -0,0 +1 @@
1
+ .waitingAnimation>:last-child::after{display:inline-block;content:'';width:3px;height:14px;transform:translate(4px,2px) scaleY(1.3);background-color:#2b5fd9;animation:blink .6s infinite}.animation{height:20px}.animation::after{display:inline-block;content:'';width:3px;height:14px;transform:translate(4px,2px) scaleY(1.3);background-color:#2b5fd9;animation:blink 1.2s infinite}@keyframes blink{from,to{opacity:0}50%{opacity:1}}.ywkf-markdown>:first-child{margin-top:0!important}.ywkf-markdown>:last-child{margin-bottom:0!important}.ywkf-markdown a.absent{color:#c00}.ywkf-markdown a.anchor{bottom:0;cursor:pointer;display:block;left:0;margin-left:-30px;padding-left:30px;position:absolute;top:0}.ywkf-markdown h1,.ywkf-markdown h2,.ywkf-markdown h3,.ywkf-markdown h4,.ywkf-markdown h5,.ywkf-markdown h6{cursor:text;font-weight:700;margin:10px 0;padding:0;position:relative}.ywkf-markdown h1 .mini-icon-link,.ywkf-markdown h2 .mini-icon-link,.ywkf-markdown h3 .mini-icon-link,.ywkf-markdown h4 .mini-icon-link,.ywkf-markdown h5 .mini-icon-link,.ywkf-markdown h6 .mini-icon-link{display:none}.ywkf-markdown h1:hover a.anchor,.ywkf-markdown h2:hover a.anchor,.ywkf-markdown h3:hover a.anchor,.ywkf-markdown h4:hover a.anchor,.ywkf-markdown h5:hover a.anchor,.ywkf-markdown h6:hover a.anchor{line-height:1;margin-left:-22px;padding-left:0;text-decoration:none;top:15%}.ywkf-markdown h1:hover a.anchor .mini-icon-link,.ywkf-markdown h2:hover a.anchor .mini-icon-link,.ywkf-markdown h3:hover a.anchor .mini-icon-link,.ywkf-markdown h4:hover a.anchor .mini-icon-link,.ywkf-markdown h5:hover a.anchor .mini-icon-link,.ywkf-markdown h6:hover a.anchor .mini-icon-link{display:inline-block}.ywkf-markdown h1 code,.ywkf-markdown h1 tt,.ywkf-markdown h2 code,.ywkf-markdown h2 tt,.ywkf-markdown h3 code,.ywkf-markdown h3 tt,.ywkf-markdown h4 code,.ywkf-markdown h4 tt,.ywkf-markdown h5 code,.ywkf-markdown h5 tt,.ywkf-markdown h6 code,.ywkf-markdown h6 tt{font-size:inherit}.ywkf-markdown h1{font-size:28px}.ywkf-markdown h2{font-size:24px}.ywkf-markdown h3{font-size:18px}.ywkf-markdown h4{font-size:16px}.ywkf-markdown h5{font-size:14px}.ywkf-markdown h6{font-size:12px}.ywkf-markdown blockquote,.ywkf-markdown dl,.ywkf-markdown ol,.ywkf-markdown p,.ywkf-markdown pre,.ywkf-markdown table,.ywkf-markdown ul{margin:14px 0}.ywkf-markdown>h1:first-child,.ywkf-markdown>h1:first-child+h2,.ywkf-markdown>h2:first-child,.ywkf-markdown>h3:first-child,.ywkf-markdown>h4:first-child,.ywkf-markdown>h5:first-child,.ywkf-markdown>h6:first-child{margin-top:0;padding-top:0}.ywkf-markdown a:first-child h1,.ywkf-markdown a:first-child h2,.ywkf-markdown a:first-child h3,.ywkf-markdown a:first-child h4,.ywkf-markdown a:first-child h5,.ywkf-markdown a:first-child h6{margin-top:0;padding-top:0}.ywkf-markdown h1+p,.ywkf-markdown h2+p,.ywkf-markdown h3+p,.ywkf-markdown h4+p,.ywkf-markdown h5+p,.ywkf-markdown h6+p{margin-top:0}.ywkf-markdown li p.first{display:inline-block}.ywkf-markdown ol,.ywkf-markdown ul{padding-left:2em}.ywkf-markdown ol.no-list,.ywkf-markdown ul.no-list{list-style-type:none;padding:0}.ywkf-markdown ol li>:first-child,.ywkf-markdown ul li>:first-child{margin-top:0}.ywkf-markdown ol,.ywkf-markdown ul{padding-left:14px}.ywkf-markdown dl{padding:0}.ywkf-markdown dl dt{font-size:14px;font-style:italic;font-weight:700;margin:15px 0 5px;padding:0}.ywkf-markdown dl dt:first-child{padding:0}.ywkf-markdown dl dt>:first-child{margin-top:0}.ywkf-markdown dl dt>:last-child{margin-bottom:0}.ywkf-markdown dl dd{margin:0 0 15px;padding:0 15px}.ywkf-markdown dl dd>:first-child{margin-top:0}.ywkf-markdown dl dd>:last-child{margin-bottom:0}.ywkf-markdown blockquote{border-left:4px solid #ddd;color:#777;padding:0 15px}.ywkf-markdown blockquote>:first-child{margin-top:0}.ywkf-markdown blockquote>:last-child{margin-bottom:0}.ywkf-markdown table{width:100%}.ywkf-markdown table th{font-weight:700}.ywkf-markdown table td,.ywkf-markdown table th{padding:6px 13px}.ywkf-markdown table tr{background-color:#fff}.ywkf-markdown table tr:nth-child(2n){background-color:#f0f0f0}.ywkf-markdown img{max-width:100%}.ywkf-markdown span.frame{display:block;overflow:hidden}.ywkf-markdown span.frame>span{border:1px solid #ddd;display:block;float:left;margin:13px 0 0;overflow:hidden;padding:7px;width:auto}.ywkf-markdown span.frame span img{display:block;float:left}.ywkf-markdown span.frame span span{clear:both;color:#333;display:block;padding:5px 0 0}.ywkf-markdown span.align-center{clear:both;display:block;overflow:hidden}.ywkf-markdown span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.ywkf-markdown span.align-center span img{margin:0 auto;text-align:center}.ywkf-markdown span.align-right{clear:both;display:block;overflow:hidden}.ywkf-markdown span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.ywkf-markdown span.align-right span img{margin:0;text-align:right}.ywkf-markdown span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.ywkf-markdown span.float-left span{margin:13px 0 0}.ywkf-markdown span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.ywkf-markdown span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.ywkf-markdown code{border-radius:3px;font-size:14px;margin:0 2px;padding:2px 4px;background:rgba(0,0,0,.06)}.ywkf-markdown tt{border:1px solid #dee0e2;background-color:#f4f6f8;border-radius:3px;margin:0 2px;padding:0 5px}.ywkf-markdown pre>code{background:none repeat scroll 0 0 transparent;border:medium none;margin:0;padding:0}.ywkf-markdown .highlight pre,.ywkf-markdown pre{border:1px solid #ccc;border-radius:3px 3px 3px 3px;font-size:max(.9em,14px);line-height:19px;overflow:auto;padding:6px 10px}.ywkf-markdown pre code,.ywkf-markdown pre tt{background-color:transparent;border:medium none}.ywkf-markdown hr{margin:10px 0}.ywkf-markdown{tab-size:4;word-spacing:normal;width:100%}.ywkf-markdown *{word-break:break-word}.ywkf-markdown pre{display:block;width:100%;padding:15px;margin:0;border:none;border-radius:0;overflow-x:auto;color:#fff;overflow:auto}.ywkf-markdown pre:has(code){color:#fff;background:#4c3f33!important;text-shadow:0 -.1em .2em #000;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;font-size:85%;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;tab-size:4;padding:1em;overflow:auto;border-radius:4px;box-shadow:1px 1px .5em #000 inset}.ywkf-markdown pre:has(code)::-webkit-scrollbar{height:6px;background:0 0}.ywkf-markdown pre:has(code)::-webkit-scrollbar-thumb{background:#8e8e8e;border-radius:10px}.ywkf-markdown pre code{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:initial;border:0}.ywkf-markdown a{text-decoration:underline;color:#2b5fd9}.ywkf-markdown table{border-collapse:separate;border-spacing:0;color:#2d3748}.ywkf-markdown table thead tr:first-child th{border-bottom-width:1px;border-left-width:1px;border-top-width:1px;border-color:#ccc;background-color:rgba(236,236,241,.2);overflow:hidden}.ywkf-markdown table thead tr:first-child th:first-child{border-top-left-radius:.375rem}.ywkf-markdown table thead tr:first-child th:last-child{border-right-width:1px;border-top-right-radius:.375rem}.ywkf-markdown table td{border-bottom-width:1px;border-left-width:1px;border-color:#ccc}.ywkf-markdown table td:last-of-type{border-right-width:1px}.ywkf-markdown table tbody tr:last-child{overflow:hidden}.ywkf-markdown table tbody tr:last-child td:first-child{border-bottom-left-radius:.375rem}.ywkf-markdown table tbody tr:last-child td:last-child{border-bottom-right-radius:.375rem}.mermaid{overflow-x:auto}
@@ -0,0 +1 @@
1
+ .dumi-btn{font-size:14px;height:32px;padding:4px 15px;border-radius:6px;transition:all .3s;cursor:pointer}.dumi-btn-default{background:#fff;color:#333;border:1px solid #d9d9d9}.dumi-btn-default:hover{color:#4d90fe;border-color:#4d90fe}.dumi-btn-primary{color:#fff;background:#4d90fe;border:1px solid #4d90fe}
@@ -71,6 +71,7 @@ export interface PromptInputProps {
71
71
  maxLength?: number;
72
72
  readOnly?: boolean;
73
73
  bordered?: boolean;
74
+ placeholder?: string;
74
75
  }
75
76
  declare const PromptInput: React.FC<PromptInputProps>;
76
77
  export default PromptInput;
@@ -88,7 +88,6 @@ var CustomEditor = {
88
88
  }));
89
89
  if (matches.length > 0) {
90
90
  var _matches$ = _slicedToArray(matches[0], 2),
91
- node = _matches$[0],
92
91
  path = _matches$[1];
93
92
 
94
93
  // 更新节点的值
@@ -141,14 +140,161 @@ var withInlineNodes = function withInlineNodes(editor) {
141
140
 
142
141
  // 编辑器组件
143
142
 
144
- var RichTextEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
145
- var initialData = _ref.initialData,
146
- onChange = _ref.onChange,
147
- propValue = _ref.value,
148
- minHeight = _ref.minHeight,
149
- maxLength = _ref.maxLength,
150
- readOnly = _ref.readOnly,
151
- bordered = _ref.bordered;
143
+ // 渲染选择元素
144
+
145
+ var SelectElementComponent = function SelectElementComponent(_ref) {
146
+ var attributes = _ref.attributes,
147
+ children = _ref.children,
148
+ element = _ref.element,
149
+ editor = _ref.editor,
150
+ readOnly = _ref.readOnly;
151
+ var _useState = useState(false),
152
+ _useState2 = _slicedToArray(_useState, 2),
153
+ open = _useState2[0],
154
+ setOpen = _useState2[1];
155
+ // 处理删除
156
+ var handleDelete = function handleDelete() {
157
+ if (readOnly) return;
158
+ CustomEditor.removeElement(editor, element);
159
+ };
160
+ var handleSelect = function handleSelect(key) {
161
+ if (readOnly) return;
162
+ // 防止丢失焦点
163
+ var savedSelection = editor.selection;
164
+
165
+ // 更新值
166
+ CustomEditor.updateElementValue(editor, 'select', element.id, key);
167
+
168
+ // 关闭下拉菜单
169
+ setOpen(false);
170
+
171
+ // 防止编辑器失去焦点
172
+ setTimeout(function () {
173
+ // 尝试恢复之前的选择状态
174
+ if (savedSelection) {
175
+ Transforms.select(editor, savedSelection);
176
+ }
177
+ // 确保编辑器获得焦点
178
+ ReactEditor.focus(editor);
179
+ }, 10); // 稍微增加延迟确保DOM已更新
180
+ };
181
+ return /*#__PURE__*/React.createElement(Dropdown, {
182
+ trigger: readOnly ? [] : ['click'],
183
+ open: readOnly ? false : open,
184
+ onOpenChange: readOnly ? undefined : setOpen,
185
+ getPopupContainer: function getPopupContainer(triggerNode) {
186
+ return triggerNode.parentElement || document.body;
187
+ },
188
+ menu: {
189
+ items: element.options.map(function (option) {
190
+ return {
191
+ key: option.value,
192
+ label: option.label
193
+ };
194
+ }),
195
+ selectedKeys: [element.value],
196
+ onClick: readOnly ? undefined : function (e) {
197
+ handleSelect(e.key);
198
+ }
199
+ }
200
+ // overlayClassName='w-full'
201
+ // getPopupContainer={(triggerNode) => triggerNode.parentElement || document.body}
202
+ }, /*#__PURE__*/React.createElement("span", _extends({}, attributes, {
203
+ contentEditable: false,
204
+ className: "select-none",
205
+ style: {
206
+ padding: '0 6px',
207
+ margin: '0 1px',
208
+ display: 'inline-block',
209
+ borderRadius: '4px',
210
+ background: '#e6f7ff',
211
+ border: '1px solid #91d5ff',
212
+ verticalAlign: 'middle',
213
+ userSelect: 'none',
214
+ lineHeight: '21px',
215
+ cursor: readOnly ? 'default' : 'pointer'
216
+ }
217
+ }), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement("span", {
218
+ style: {
219
+ margin: '0 3px',
220
+ fontSize: '12px',
221
+ textAlign: 'center'
222
+ }
223
+ }, element.value), !readOnly && /*#__PURE__*/React.createElement(DownOutlined, {
224
+ className: "down-icon ".concat(open ? 'down-icon-open' : '')
225
+ })), !readOnly && /*#__PURE__*/React.createElement("span", {
226
+ style: {
227
+ cursor: 'pointer',
228
+ fontSize: '12px',
229
+ marginLeft: '12px',
230
+ color: '#999',
231
+ textAlign: 'center'
232
+ },
233
+ onClick: function onClick(e) {
234
+ e.stopPropagation();
235
+ handleDelete();
236
+ }
237
+ }, "\xD7"), children));
238
+ };
239
+
240
+ // 标签元素
241
+
242
+ var TagElementComponent = function TagElementComponent(_ref2) {
243
+ var attributes = _ref2.attributes,
244
+ children = _ref2.children,
245
+ element = _ref2.element,
246
+ editor = _ref2.editor,
247
+ readOnly = _ref2.readOnly;
248
+ // 处理删除
249
+ var handleDelete = function handleDelete() {
250
+ if (readOnly) return;
251
+ CustomEditor.removeElement(editor, element);
252
+ };
253
+ return /*#__PURE__*/React.createElement("span", _extends({}, attributes, {
254
+ contentEditable: false,
255
+ style: {
256
+ padding: '0px 6px',
257
+ margin: '0 1px',
258
+ display: 'inline-block',
259
+ borderRadius: '4px',
260
+ background: '#f6ffed',
261
+ border: '1px solid #b7eb8f',
262
+ verticalAlign: 'middle',
263
+ userSelect: 'none',
264
+ lineHeight: '21px',
265
+ cursor: readOnly ? 'default' : 'pointer'
266
+ }
267
+ }), /*#__PURE__*/React.createElement("span", {
268
+ style: {
269
+ margin: '0 3px',
270
+ fontSize: '12px'
271
+ }
272
+ }, element.value, !readOnly && /*#__PURE__*/React.createElement("span", {
273
+ onClick: handleDelete,
274
+ style: {
275
+ cursor: 'pointer',
276
+ fontSize: '14px',
277
+ marginLeft: '4px',
278
+ color: '#999'
279
+ }
280
+ }, "\xD7")), children);
281
+ };
282
+
283
+ // 默认段落元素
284
+
285
+ var DefaultElement = function DefaultElement(props) {
286
+ return /*#__PURE__*/React.createElement("div", props.attributes, props.children);
287
+ };
288
+ var RichTextEditor = /*#__PURE__*/forwardRef(function (_ref3, ref) {
289
+ var initialData = _ref3.initialData,
290
+ onChange = _ref3.onChange,
291
+ propValue = _ref3.value,
292
+ minHeight = _ref3.minHeight,
293
+ maxLength = _ref3.maxLength,
294
+ readOnly = _ref3.readOnly,
295
+ bordered = _ref3.bordered,
296
+ _ref3$placeholder = _ref3.placeholder,
297
+ placeholder = _ref3$placeholder === void 0 ? '输入文本...' : _ref3$placeholder;
152
298
  // 创建编辑器实例
153
299
  var editor = useMemo(function () {
154
300
  return withInlineNodes(withReact(createEditor()));
@@ -223,12 +369,12 @@ var RichTextEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
223
369
  };
224
370
 
225
371
  // 初始内容 - 只使用initialData或propValue其中一个作为初始值
226
- var _useState = useState(function () {
372
+ var _useState3 = useState(function () {
227
373
  return convertInputToSlateNodes(initialData || propValue);
228
374
  }),
229
- _useState2 = _slicedToArray(_useState, 2),
230
- value = _useState2[0],
231
- setValue = _useState2[1];
375
+ _useState4 = _slicedToArray(_useState3, 2),
376
+ value = _useState4[0],
377
+ setValue = _useState4[1];
232
378
 
233
379
  // 使用useEffect监听propValue的变化
234
380
  useEffect(function () {
@@ -443,7 +589,7 @@ var RichTextEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
443
589
  }, /*#__PURE__*/React.createElement(Editable, {
444
590
  className: "editable-wrapper ".concat(readOnly ? 'editable-wrapper-read-only' : ''),
445
591
  renderElement: renderElement,
446
- placeholder: readOnly ? '' : '输入文本...',
592
+ placeholder: readOnly ? '' : placeholder,
447
593
  onKeyDown: readOnly ? undefined : handleKeyDown,
448
594
  onPaste: readOnly ? undefined : handlePaste,
449
595
  readOnly: readOnly,
@@ -451,152 +597,6 @@ var RichTextEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
451
597
  }))));
452
598
  });
453
599
 
454
- // 渲染选择元素
455
-
456
- var SelectElementComponent = function SelectElementComponent(_ref2) {
457
- var attributes = _ref2.attributes,
458
- children = _ref2.children,
459
- element = _ref2.element,
460
- editor = _ref2.editor,
461
- readOnly = _ref2.readOnly;
462
- var _useState3 = useState(false),
463
- _useState4 = _slicedToArray(_useState3, 2),
464
- open = _useState4[0],
465
- setOpen = _useState4[1];
466
- // 处理删除
467
- var handleDelete = function handleDelete() {
468
- if (readOnly) return;
469
- CustomEditor.removeElement(editor, element);
470
- };
471
- var handleSelect = function handleSelect(key) {
472
- if (readOnly) return;
473
- // 防止丢失焦点
474
- var savedSelection = editor.selection;
475
-
476
- // 更新值
477
- CustomEditor.updateElementValue(editor, 'select', element.id, key);
478
-
479
- // 关闭下拉菜单
480
- setOpen(false);
481
-
482
- // 防止编辑器失去焦点
483
- setTimeout(function () {
484
- // 尝试恢复之前的选择状态
485
- if (savedSelection) {
486
- Transforms.select(editor, savedSelection);
487
- }
488
- // 确保编辑器获得焦点
489
- ReactEditor.focus(editor);
490
- }, 10); // 稍微增加延迟确保DOM已更新
491
- };
492
- return /*#__PURE__*/React.createElement(Dropdown, {
493
- trigger: readOnly ? [] : ['click'],
494
- open: readOnly ? false : open,
495
- onOpenChange: readOnly ? undefined : setOpen,
496
- getPopupContainer: function getPopupContainer(triggerNode) {
497
- return triggerNode.parentElement || document.body;
498
- },
499
- menu: {
500
- items: element.options.map(function (option) {
501
- return {
502
- key: option.value,
503
- label: option.label
504
- };
505
- }),
506
- selectedKeys: [element.value],
507
- onClick: readOnly ? undefined : function (e) {
508
- handleSelect(e.key);
509
- }
510
- }
511
- // overlayClassName='w-full'
512
- // getPopupContainer={(triggerNode) => triggerNode.parentElement || document.body}
513
- }, /*#__PURE__*/React.createElement("span", _extends({}, attributes, {
514
- contentEditable: false,
515
- className: "select-none",
516
- style: {
517
- padding: '0 6px',
518
- margin: '0 1px',
519
- display: 'inline-block',
520
- borderRadius: '4px',
521
- background: '#e6f7ff',
522
- border: '1px solid #91d5ff',
523
- verticalAlign: 'middle',
524
- userSelect: 'none',
525
- lineHeight: '21px',
526
- cursor: readOnly ? 'default' : 'pointer'
527
- }
528
- }), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement("span", {
529
- style: {
530
- margin: '0 3px',
531
- fontSize: '12px',
532
- textAlign: 'center'
533
- }
534
- }, element.value), !readOnly && /*#__PURE__*/React.createElement(DownOutlined, {
535
- className: "down-icon ".concat(open ? 'down-icon-open' : '')
536
- })), !readOnly && /*#__PURE__*/React.createElement("span", {
537
- style: {
538
- cursor: 'pointer',
539
- fontSize: '12px',
540
- marginLeft: '12px',
541
- color: '#999',
542
- textAlign: 'center'
543
- },
544
- onClick: function onClick(e) {
545
- e.stopPropagation();
546
- handleDelete();
547
- }
548
- }, "\xD7"), children));
549
- };
550
-
551
- // 默认段落元素
552
-
553
- var DefaultElement = function DefaultElement(props) {
554
- return /*#__PURE__*/React.createElement("div", props.attributes, props.children);
555
- };
556
-
557
- // 标签元素
558
-
559
- var TagElementComponent = function TagElementComponent(_ref3) {
560
- var attributes = _ref3.attributes,
561
- children = _ref3.children,
562
- element = _ref3.element,
563
- editor = _ref3.editor,
564
- readOnly = _ref3.readOnly;
565
- // 处理删除
566
- var handleDelete = function handleDelete() {
567
- if (readOnly) return;
568
- CustomEditor.removeElement(editor, element);
569
- };
570
- return /*#__PURE__*/React.createElement("span", _extends({}, attributes, {
571
- contentEditable: false,
572
- style: {
573
- padding: '0px 6px',
574
- margin: '0 1px',
575
- display: 'inline-block',
576
- borderRadius: '4px',
577
- background: '#f6ffed',
578
- border: '1px solid #b7eb8f',
579
- verticalAlign: 'middle',
580
- userSelect: 'none',
581
- lineHeight: '21px',
582
- cursor: readOnly ? 'default' : 'pointer'
583
- }
584
- }), /*#__PURE__*/React.createElement("span", {
585
- style: {
586
- margin: '0 3px',
587
- fontSize: '12px'
588
- }
589
- }, element.value, !readOnly && /*#__PURE__*/React.createElement("span", {
590
- onClick: handleDelete,
591
- style: {
592
- cursor: 'pointer',
593
- fontSize: '14px',
594
- marginLeft: '4px',
595
- color: '#999'
596
- }
597
- }, "\xD7")), children);
598
- };
599
-
600
600
  // 修改 PromptInput 组件以支持 Form 双向绑定
601
601
 
602
602
  var PromptInput = function PromptInput(_ref4) {
@@ -609,7 +609,8 @@ var PromptInput = function PromptInput(_ref4) {
609
609
  maxLength = _ref4$maxLength === void 0 ? 500 : _ref4$maxLength,
610
610
  readOnly = _ref4.readOnly,
611
611
  _ref4$bordered = _ref4.bordered,
612
- bordered = _ref4$bordered === void 0 ? true : _ref4$bordered;
612
+ bordered = _ref4$bordered === void 0 ? true : _ref4$bordered,
613
+ placeholder = _ref4.placeholder;
613
614
  var internalRef = useRef(null);
614
615
  var promptInputRef = externalRef || internalRef;
615
616
  var handleChange = useCallback(function (data) {
@@ -625,7 +626,8 @@ var PromptInput = function PromptInput(_ref4) {
625
626
  minHeight: minHeight,
626
627
  maxLength: maxLength,
627
628
  readOnly: readOnly,
628
- bordered: bordered
629
+ bordered: bordered,
630
+ placeholder: placeholder
629
631
  });
630
632
  };
631
633
  export default PromptInput;
@@ -0,0 +1 @@
1
+ .editor-wrapper{border:1px solid;border-radius:8px;display:flex;flex-direction:column;padding:4px 8px}.editor-wrapper-read-only{border-color:#d9d9d9;background-color:#f5f5f5;cursor:default}.editor-wrapper-edit{border-color:#d9d9d9}.editor-wrapper-edit:focus{outline:0;border-color:#4080ff}.editor-wrapper-edit:hover{border-color:#4080ff}.editor-wrapper-no-border{border:none}.editable-wrapper{height:100%;width:100%;flex:1}.editable-wrapper:focus{outline:0}.editable-wrapper:hover{border-color:#4080ff}.editable-wrapper-read-only{cursor:default}.down-icon{transition:transform .2s ease-in-out;color:rgba(0,0,0,.45);font-size:12px!important}.down-icon-open{transform:rotate(180deg)}
@@ -0,0 +1 @@
1
+ .code-header{display:flex;padding-top:.5rem;padding-bottom:.5rem;padding-inline-start:1.25rem;padding-inline-end:1.25rem;background:#7a6651;color:#ffff;border-color:#e2e8f0}
@@ -0,0 +1 @@
1
+ .waitingAnimation>:last-child::after{display:inline-block;content:'';width:3px;height:14px;transform:translate(4px,2px) scaleY(1.3);background-color:#2b5fd9;animation:blink .6s infinite}.animation{height:20px}.animation::after{display:inline-block;content:'';width:3px;height:14px;transform:translate(4px,2px) scaleY(1.3);background-color:#2b5fd9;animation:blink 1.2s infinite}@keyframes blink{from,to{opacity:0}50%{opacity:1}}.ywkf-markdown>:first-child{margin-top:0!important}.ywkf-markdown>:last-child{margin-bottom:0!important}.ywkf-markdown a.absent{color:#c00}.ywkf-markdown a.anchor{bottom:0;cursor:pointer;display:block;left:0;margin-left:-30px;padding-left:30px;position:absolute;top:0}.ywkf-markdown h1,.ywkf-markdown h2,.ywkf-markdown h3,.ywkf-markdown h4,.ywkf-markdown h5,.ywkf-markdown h6{cursor:text;font-weight:700;margin:10px 0;padding:0;position:relative}.ywkf-markdown h1 .mini-icon-link,.ywkf-markdown h2 .mini-icon-link,.ywkf-markdown h3 .mini-icon-link,.ywkf-markdown h4 .mini-icon-link,.ywkf-markdown h5 .mini-icon-link,.ywkf-markdown h6 .mini-icon-link{display:none}.ywkf-markdown h1:hover a.anchor,.ywkf-markdown h2:hover a.anchor,.ywkf-markdown h3:hover a.anchor,.ywkf-markdown h4:hover a.anchor,.ywkf-markdown h5:hover a.anchor,.ywkf-markdown h6:hover a.anchor{line-height:1;margin-left:-22px;padding-left:0;text-decoration:none;top:15%}.ywkf-markdown h1:hover a.anchor .mini-icon-link,.ywkf-markdown h2:hover a.anchor .mini-icon-link,.ywkf-markdown h3:hover a.anchor .mini-icon-link,.ywkf-markdown h4:hover a.anchor .mini-icon-link,.ywkf-markdown h5:hover a.anchor .mini-icon-link,.ywkf-markdown h6:hover a.anchor .mini-icon-link{display:inline-block}.ywkf-markdown h1 code,.ywkf-markdown h1 tt,.ywkf-markdown h2 code,.ywkf-markdown h2 tt,.ywkf-markdown h3 code,.ywkf-markdown h3 tt,.ywkf-markdown h4 code,.ywkf-markdown h4 tt,.ywkf-markdown h5 code,.ywkf-markdown h5 tt,.ywkf-markdown h6 code,.ywkf-markdown h6 tt{font-size:inherit}.ywkf-markdown h1{font-size:28px}.ywkf-markdown h2{font-size:24px}.ywkf-markdown h3{font-size:18px}.ywkf-markdown h4{font-size:16px}.ywkf-markdown h5{font-size:14px}.ywkf-markdown h6{font-size:12px}.ywkf-markdown blockquote,.ywkf-markdown dl,.ywkf-markdown ol,.ywkf-markdown p,.ywkf-markdown pre,.ywkf-markdown table,.ywkf-markdown ul{margin:14px 0}.ywkf-markdown>h1:first-child,.ywkf-markdown>h1:first-child+h2,.ywkf-markdown>h2:first-child,.ywkf-markdown>h3:first-child,.ywkf-markdown>h4:first-child,.ywkf-markdown>h5:first-child,.ywkf-markdown>h6:first-child{margin-top:0;padding-top:0}.ywkf-markdown a:first-child h1,.ywkf-markdown a:first-child h2,.ywkf-markdown a:first-child h3,.ywkf-markdown a:first-child h4,.ywkf-markdown a:first-child h5,.ywkf-markdown a:first-child h6{margin-top:0;padding-top:0}.ywkf-markdown h1+p,.ywkf-markdown h2+p,.ywkf-markdown h3+p,.ywkf-markdown h4+p,.ywkf-markdown h5+p,.ywkf-markdown h6+p{margin-top:0}.ywkf-markdown li p.first{display:inline-block}.ywkf-markdown ol,.ywkf-markdown ul{padding-left:2em}.ywkf-markdown ol.no-list,.ywkf-markdown ul.no-list{list-style-type:none;padding:0}.ywkf-markdown ol li>:first-child,.ywkf-markdown ul li>:first-child{margin-top:0}.ywkf-markdown ol,.ywkf-markdown ul{padding-left:14px}.ywkf-markdown dl{padding:0}.ywkf-markdown dl dt{font-size:14px;font-style:italic;font-weight:700;margin:15px 0 5px;padding:0}.ywkf-markdown dl dt:first-child{padding:0}.ywkf-markdown dl dt>:first-child{margin-top:0}.ywkf-markdown dl dt>:last-child{margin-bottom:0}.ywkf-markdown dl dd{margin:0 0 15px;padding:0 15px}.ywkf-markdown dl dd>:first-child{margin-top:0}.ywkf-markdown dl dd>:last-child{margin-bottom:0}.ywkf-markdown blockquote{border-left:4px solid #ddd;color:#777;padding:0 15px}.ywkf-markdown blockquote>:first-child{margin-top:0}.ywkf-markdown blockquote>:last-child{margin-bottom:0}.ywkf-markdown table{width:100%}.ywkf-markdown table th{font-weight:700}.ywkf-markdown table td,.ywkf-markdown table th{padding:6px 13px}.ywkf-markdown table tr{background-color:#fff}.ywkf-markdown table tr:nth-child(2n){background-color:#f0f0f0}.ywkf-markdown img{max-width:100%}.ywkf-markdown span.frame{display:block;overflow:hidden}.ywkf-markdown span.frame>span{border:1px solid #ddd;display:block;float:left;margin:13px 0 0;overflow:hidden;padding:7px;width:auto}.ywkf-markdown span.frame span img{display:block;float:left}.ywkf-markdown span.frame span span{clear:both;color:#333;display:block;padding:5px 0 0}.ywkf-markdown span.align-center{clear:both;display:block;overflow:hidden}.ywkf-markdown span.align-center>span{display:block;margin:13px auto 0;overflow:hidden;text-align:center}.ywkf-markdown span.align-center span img{margin:0 auto;text-align:center}.ywkf-markdown span.align-right{clear:both;display:block;overflow:hidden}.ywkf-markdown span.align-right>span{display:block;margin:13px 0 0;overflow:hidden;text-align:right}.ywkf-markdown span.align-right span img{margin:0;text-align:right}.ywkf-markdown span.float-left{display:block;float:left;margin-right:13px;overflow:hidden}.ywkf-markdown span.float-left span{margin:13px 0 0}.ywkf-markdown span.float-right{display:block;float:right;margin-left:13px;overflow:hidden}.ywkf-markdown span.float-right>span{display:block;margin:13px auto 0;overflow:hidden;text-align:right}.ywkf-markdown code{border-radius:3px;font-size:14px;margin:0 2px;padding:2px 4px;background:rgba(0,0,0,.06)}.ywkf-markdown tt{border:1px solid #dee0e2;background-color:#f4f6f8;border-radius:3px;margin:0 2px;padding:0 5px}.ywkf-markdown pre>code{background:none repeat scroll 0 0 transparent;border:medium none;margin:0;padding:0}.ywkf-markdown .highlight pre,.ywkf-markdown pre{border:1px solid #ccc;border-radius:3px 3px 3px 3px;font-size:max(.9em,14px);line-height:19px;overflow:auto;padding:6px 10px}.ywkf-markdown pre code,.ywkf-markdown pre tt{background-color:transparent;border:medium none}.ywkf-markdown hr{margin:10px 0}.ywkf-markdown{tab-size:4;word-spacing:normal;width:100%}.ywkf-markdown *{word-break:break-word}.ywkf-markdown pre{display:block;width:100%;padding:15px;margin:0;border:none;border-radius:0;overflow-x:auto;color:#fff;overflow:auto}.ywkf-markdown pre:has(code){color:#fff;background:#4c3f33!important;text-shadow:0 -.1em .2em #000;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;font-size:85%;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;tab-size:4;padding:1em;overflow:auto;border-radius:4px;box-shadow:1px 1px .5em #000 inset}.ywkf-markdown pre:has(code)::-webkit-scrollbar{height:6px;background:0 0}.ywkf-markdown pre:has(code)::-webkit-scrollbar-thumb{background:#8e8e8e;border-radius:10px}.ywkf-markdown pre code{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:initial;border:0}.ywkf-markdown a{text-decoration:underline;color:#2b5fd9}.ywkf-markdown table{border-collapse:separate;border-spacing:0;color:#2d3748}.ywkf-markdown table thead tr:first-child th{border-bottom-width:1px;border-left-width:1px;border-top-width:1px;border-color:#ccc;background-color:rgba(236,236,241,.2);overflow:hidden}.ywkf-markdown table thead tr:first-child th:first-child{border-top-left-radius:.375rem}.ywkf-markdown table thead tr:first-child th:last-child{border-right-width:1px;border-top-right-radius:.375rem}.ywkf-markdown table td{border-bottom-width:1px;border-left-width:1px;border-color:#ccc}.ywkf-markdown table td:last-of-type{border-right-width:1px}.ywkf-markdown table tbody tr:last-child{overflow:hidden}.ywkf-markdown table tbody tr:last-child td:first-child{border-bottom-left-radius:.375rem}.ywkf-markdown table tbody tr:last-child td:last-child{border-bottom-right-radius:.375rem}.mermaid{overflow-x:auto}
@@ -0,0 +1 @@
1
+ .dumi-btn{font-size:14px;height:32px;padding:4px 15px;border-radius:6px;transition:all .3s;cursor:pointer}.dumi-btn-default{background:#fff;color:#333;border:1px solid #d9d9d9}.dumi-btn-default:hover{color:#4d90fe;border-color:#4d90fe}.dumi-btn-primary{color:#fff;background:#4d90fe;border:1px solid #4d90fe}.waterfall-virtual-container{width:100%;height:100%;overflow-y:scroll;overflow-x:hidden}.waterfall-virtual-list{position:relative;width:100%}.waterfall-virtual-list-item{position:absolute;top:0;left:0;box-sizing:border-box}
@@ -0,0 +1 @@
1
+ .custom-scroll-bar .waterfall-virtual-container{width:calc(100% - 10px)}.custom-scroll-bar .waterfall-virtual-container::-webkit-scrollbar{width:0;height:0;will-change:all;background:0 0}.custom-scroll-bar .waterfall-virtual-container::-webkit-scrollbar-track{background-color:transparent}.custom-scroll-bar .waterfall-virtual-container::-webkit-scrollbar-thumb{background-color:transparent}
@@ -0,0 +1 @@
1
+ .fr-panel-bordered{border-radius:4px;border:1px solid #f4f4f4;padding:52px 24px 0 24px;margin-bottom:24px}
@@ -0,0 +1 @@
1
+ .fr-obj-card{border-radius:8px!important;border-color:#efefef!important;margin:0 0 12px!important;background:#f2f5f9!important}.fr-obj-card .header{padding:8px 12px;border-bottom:1px solid var(--lib3-text-light-border,#fff);color:#222531;font-family:PingFang SC;font-size:12px;font-style:normal;font-weight:600;line-height:20px}.fr-obj-card .body{padding:0 12px 12px}
@@ -0,0 +1 @@
1
+ .fields_image{background:var(--lib3-text-light-textarea,#fff);color:var(--lib3-text-light-title,#222531);overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;outline-color:#3162ff;border-radius:.25rem;justify-content:center;display:flex;height:188px;flex-direction:column;align-items:center;position:relative}.fields_image img{width:100%;height:186px;object-fit:contain}.fields_image:hover .mask{opacity:1!important}.fields_image .mask{opacity:0;background-color:rgba(0,0,0,.7);border-radius:.25rem;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.fields_image .mask .mask-button{color:#fff;font-size:.75rem;line-height:1;background-color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.5);border-radius:.25rem;border-width:1px;border-style:solid;cursor:pointer;height:34px;width:72px;margin-right:8px}
@@ -0,0 +1 @@
1
+ .fields_image{background:var(--lib3-text-light-textarea,#fff);color:var(--lib3-text-light-title,#222531);overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;outline-color:#3162ff;border-radius:.25rem;justify-content:center;display:flex;height:188px;flex-direction:column;align-items:center;position:relative}.fields_image img{width:100%;height:186px;object-fit:contain}.fields_image:hover .mask{opacity:1!important}.fields_image .mask{opacity:0;background-color:rgba(0,0,0,.7);border-radius:.25rem;position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.fields_image .mask .mask-button{color:#fff;font-size:.75rem;line-height:1;background-color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.5);border-radius:.25rem;border-width:1px;border-style:solid;cursor:pointer;height:34px;width:72px;margin-right:8px}
@@ -0,0 +1 @@
1
+ .fr-slider{display:flex;width:100%;align-items:center}.fr-slider-input-number{background-color:var(--color-background,#fff)!important;color:var(--color-text,#333)!important}.fr-slider-input-number .ant-input-number-input{font-size:12px!important;font-weight:400!important;padding:0!important;height:28px!important;text-align:center!important}.fr-slider-slider .ant-slider-rail{background-color:var(--lib3-text-light-textarea,#fff)!important;border-radius:100px!important;height:8px!important}.fr-slider-slider .ant-slider-track{background-color:var(--lib3-text-light-textarea,#326bff)!important;border-radius:100px!important;height:8px!important}.fr-slider-slider .ant-slider-step{height:8px!important}.fr-slider-slider .ant-slider-handle{width:14px!important;height:14px!important;top:3px!important}.fr-slider-slider .ant-slider-handle:after{width:10px!important;height:10px!important;background-color:#fff!important;box-shadow:0 0 0 3px var(--lib3-text-light-textarea,#326bff)!important}
@@ -0,0 +1 @@
1
+ .fields_textarea{background:var(--lib3-text-light-textarea,#fff);color:var(--lib3-text-light-title,#222531);overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;outline-color:#3162ff;border:unset!important;line-height:18px;font-size:.75rem;padding:.75rem;border-radius:.25rem;border:1px solid #3162ff!important;width:100%;min-height:60px;max-height:300px;height:100px;resize:none}
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4399ywkf/design",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "4399ywkf Design React UI Library.",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -108,6 +108,10 @@
108
108
  "dumi": "^2.4.21",
109
109
  "eslint": "^8.57.1",
110
110
  "father": "^4.5.2",
111
+ "gulp": "^5.0.1",
112
+ "gulp-clean-css": "^4.3.0",
113
+ "gulp-less": "^5.0.0",
114
+ "gulp-rename": "^2.1.0",
111
115
  "husky": "^8.0.3",
112
116
  "lint-staged": "^13.3.0",
113
117
  "prettier": "^2.8.8",
@@ -132,7 +136,7 @@
132
136
  ],
133
137
  "slideEffects": false,
134
138
  "scripts": {
135
- "build": "father build",
139
+ "build": "father build && gulp less",
136
140
  "build:ci": "pnpm lint && pnpm build && pnpm docs:build",
137
141
  "build:watch": "father dev",
138
142
  "changeset": "changeset",