intable 0.0.3 → 0.0.4

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.
Files changed (42) hide show
  1. package/README.md +2 -1
  2. package/dist/__uno.css +1 -1
  3. package/dist/chevron-right.js +3 -5
  4. package/dist/components/Columns.js +50 -84
  5. package/dist/components/DocTree.js +21 -29
  6. package/dist/components/Menu.js +81 -105
  7. package/dist/components/Popover.js +23 -31
  8. package/dist/components/Render.js +10 -11
  9. package/dist/components/Split.js +34 -46
  10. package/dist/components/Tree.js +38 -57
  11. package/dist/components/utils.js +4 -6
  12. package/dist/hooks/index.js +91 -128
  13. package/dist/hooks/useDir.js +22 -39
  14. package/dist/hooks/useSort.js +47 -70
  15. package/dist/hooks/useVirtualizer.js +43 -68
  16. package/dist/index.js +158 -213
  17. package/dist/loading.js +3 -5
  18. package/dist/plugins/CellMergePlugin.d.ts +0 -2
  19. package/dist/plugins/CellSelectionPlugin.js +77 -117
  20. package/dist/plugins/CommandPlugin.js +3 -6
  21. package/dist/plugins/CopyPastePlugin.js +24 -37
  22. package/dist/plugins/DiffPlugin.js +33 -45
  23. package/dist/plugins/DragPlugin.d.ts +2 -2
  24. package/dist/plugins/DragPlugin.js +29 -45
  25. package/dist/plugins/EditablePlugin.js +88 -139
  26. package/dist/plugins/ExpandPlugin.js +26 -30
  27. package/dist/plugins/HistoryPlugin.js +16 -21
  28. package/dist/plugins/MenuPlugin.js +51 -76
  29. package/dist/plugins/RenderPlugin/components.js +45 -63
  30. package/dist/plugins/RenderPlugin/index.js +29 -42
  31. package/dist/plugins/ResizePlugin.js +44 -80
  32. package/dist/plugins/RowGroupPlugin.js +57 -73
  33. package/dist/plugins/RowSelectionPlugin.js +31 -42
  34. package/dist/plugins/VirtualScrollPlugin.js +54 -79
  35. package/dist/plus.js +3 -5
  36. package/dist/style.css +2 -192
  37. package/dist/utils.js +44 -65
  38. package/dist/wc.js +11 -11
  39. package/dist/x.js +3 -5
  40. package/package.json +2 -1
  41. package/dist/plugins/DragColumnPlugin.d.ts +0 -2
  42. package/dist/plugins/DragColumnPlugin.js +0 -4
package/README.md CHANGED
@@ -5,7 +5,8 @@
5
5
  - 类似 Excel 的表格组件
6
6
  - 单元格多选、复制、粘贴
7
7
  - 单元格编辑、数据校验
8
- - 列宽、行高可拖动
8
+ - 列宽、行高可调整
9
+ - 列、行可拖拽
9
10
  - 虚拟滚动
10
11
  - 数据分组
11
12
  - 行展开
package/dist/__uno.css CHANGED
@@ -1 +1 @@
1
- @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*, ::before, ::after, ::backdrop{--un-bg-opacity:100%;--un-content:"";--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-text-opacity:100%;--un-border-opacity:100%;--un-space-y-reverse:initial;--un-space-x-reverse:initial;--un-outline-style:solid;--un-outline-opacity:100%;--un-leading:initial;}}@property --un-leading{syntax:"*";inherits:false;}@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid;}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}@property --un-translate-x{syntax:"*";inherits:false;initial-value:0;}@property --un-translate-y{syntax:"*";inherits:false;initial-value:0;}@property --un-translate-z{syntax:"*";inherits:false;initial-value:0;}:root, :host {--spacing: 0.25rem;--colors-gray-DEFAULT: oklch(70.7% 0.022 261.325);--text-sm-fontSize: 0.875rem;--text-sm-lineHeight: 1.25rem;--radius-sm: 0.25rem;--colors-blue-DEFAULT: oklch(70.7% 0.165 254.624);--font-sans: ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-font-family: var(--font-sans);--default-monoFont-family: var(--font-mono);}/* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 2. Remove default margins and padding 3. Reset all borders.*/*,::after,::before,::backdrop,::file-selector-button { box-sizing: border-box; /* 1 */ margin: 0; /* 2 */ padding: 0; /* 2 */ border: 0 solid; /* 3 */}/* 1. Use a consistent sensible line-height in all browsers. 2. Prevent adjustments of font size after orientation changes in iOS. 3. Use a more readable tab size. 4. Use the user's configured `sans` font-family by default. 5. Use the user's configured `sans` font-feature-settings by default. 6. Use the user's configured `sans` font-variation-settings by default. 7. Disable tap highlights on iOS.*/html,:host { line-height: 1.5; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ tab-size: 4; /* 3 */ font-family: var( --default-font-family, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji' ); /* 4 */ font-feature-settings: var(--default-font-featureSettings, normal); /* 5 */ font-variation-settings: var(--default-font-variationSettings, normal); /* 6 */ -webkit-tap-highlight-color: transparent; /* 7 */}/* 1. Add the correct height in Firefox. 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) 3. Reset the default border style to a 1px solid border.*/hr { height: 0; /* 1 */ color: inherit; /* 2 */ border-top-width: 1px; /* 3 */}/* Add the correct text decoration in Chrome, Edge, and Safari.*/abbr:where([title]) { -webkit-text-decoration: underline dotted; text-decoration: underline dotted;}/* Remove the default font size and weight for headings.*/h1,h2,h3,h4,h5,h6 { font-size: inherit; font-weight: inherit;}/* Reset links to optimize for opt-in styling instead of opt-out.*/a { color: inherit; -webkit-text-decoration: inherit; text-decoration: inherit;}/* Add the correct font weight in Edge and Safari.*/b,strong { font-weight: bolder;}/* 1. Use the user's configured `mono` font-family by default. 2. Use the user's configured `mono` font-feature-settings by default. 3. Use the user's configured `mono` font-variation-settings by default. 4. Correct the odd `em` font sizing in all browsers.*/code,kbd,samp,pre { font-family: var( --default-monoFont-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace ); /* 1 */ font-feature-settings: var(--default-monoFont-featureSettings, normal); /* 2 */ font-variation-settings: var(--default-monoFont-variationSettings, normal); /* 3 */ font-size: 1em; /* 4 */}/* Add the correct font size in all browsers.*/small { font-size: 80%;}/* Prevent `sub` and `sup` elements from affecting the line height in all browsers.*/sub,sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline;}sub { bottom: -0.25em;}sup { top: -0.5em;}/* 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) 3. Remove gaps between table borders by default.*/table { text-indent: 0; /* 1 */ border-color: inherit; /* 2 */ border-collapse: collapse; /* 3 */}/* Use the modern Firefox focus style for all focusable elements.*/:-moz-focusring { outline: auto;}/* Add the correct vertical alignment in Chrome and Firefox.*/progress { vertical-align: baseline;}/* Add the correct display in Chrome and Safari.*/summary { display: list-item;}/* Make lists unstyled by default.*/ol,ul,menu { list-style: none;}/* 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) This can trigger a poorly considered lint error in some tools but is included by design.*/img,svg,video,canvas,audio,iframe,embed,object { display: block; /* 1 */ vertical-align: middle; /* 2 */}/* Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)*/img,video { max-width: 100%; height: auto;}/* 1. Inherit font styles in all browsers. 2. Remove border radius in all browsers. 3. Remove background color in all browsers. 4. Ensure consistent opacity for disabled states in all browsers.*/button,input,select,optgroup,textarea,::file-selector-button { font: inherit; /* 1 */ font-feature-settings: inherit; /* 1 */ font-variation-settings: inherit; /* 1 */ letter-spacing: inherit; /* 1 */ color: inherit; /* 1 */ border-radius: 0; /* 2 */ background-color: transparent; /* 3 */ opacity: 1; /* 4 */}/* Restore default font weight.*/:where(select:is([multiple], [size])) optgroup { font-weight: bolder;}/* Restore indentation.*/:where(select:is([multiple], [size])) optgroup option { padding-inline-start: 20px;}/* Restore space after button.*/::file-selector-button { margin-inline-end: 4px;}/* Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)*/::placeholder { opacity: 1;}/* Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not crash when using `color-mix(…)` with `currentcolor`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)*/@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or (contain-intrinsic-size: 1px) /* Safari 17+ */ { ::placeholder { color: color-mix(in oklab, currentcolor 50%, transparent); }}/* Prevent resizing textareas horizontally by default.*/textarea { resize: vertical;}/* Remove the inner padding in Chrome and Safari on macOS.*/::-webkit-search-decoration { -webkit-appearance: none;}/* 1. Ensure date/time inputs have the same height when empty in iOS Safari. 2. Ensure text alignment can be changed on date/time inputs in iOS Safari.*/::-webkit-date-and-time-value { min-height: 1lh; /* 1 */ text-align: inherit; /* 2 */}/* Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.*/::-webkit-datetime-edit { display: inline-flex;}/* Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.*/::-webkit-datetime-edit-fields-wrapper { padding: 0;}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field { padding-block: 0;}/* Center dropdown marker shown on inputs with paired `<datalist>`s in Chrome. (https://github.com/tailwindlabs/tailwindcss/issues/18499)*/::-webkit-calendar-picker-indicator { line-height: 1;}/* Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)*/:-moz-ui-invalid { box-shadow: none;}/* Correct the inability to style the border radius in iOS Safari.*/button,input:where([type='button'], [type='reset'], [type='submit']),::file-selector-button { appearance: button;}/* Correct the cursor style of increment and decrement buttons in Safari.*/::-webkit-inner-spin-button,::-webkit-outer-spin-button { height: auto;}/* Make elements with the HTML hidden attribute stay hidden by default.*/[hidden]:where(:not([hidden~='until-found'])) { display: none !important;}.container{width:100%;}.aic{align-items:center;}@media (min-width: 40rem){.container{max-width:40rem;}}@media (min-width: 48rem){.container{max-width:48rem;}}@media (min-width: 64rem){.container{max-width:64rem;}}@media (min-width: 80rem){.container{max-width:80rem;}}@media (min-width: 96rem){.container{max-width:96rem;}}.text-3\.5{font-size:0.875rem;}.lh-\[1\]{--un-leading:1;line-height:1;}.m9{margin:calc(var(--spacing) * 9);}.mx-1{margin-inline:calc(var(--spacing) * 1);}.mx-3\!{margin-inline:calc(var(--spacing) * 3) !important;}.my-1{margin-block:calc(var(--spacing) * 1);}.ml{margin-left:calc(var(--spacing) * 4);}.ml-\.5{margin-left:calc(var(--spacing) * 0.5);}.ml-1{margin-left:calc(var(--spacing) * 1);}.mr--1{margin-right:calc(var(--spacing) * -1);}.mr-1{margin-right:calc(var(--spacing) * 1);}.mr-2{margin-right:calc(var(--spacing) * 2);}.mr-2\.5{margin-right:calc(var(--spacing) * 2.5);}.p-1{padding:calc(var(--spacing) * 1);}.px,.px-4{padding-inline:calc(var(--spacing) * 4);}.px-2{padding-inline:calc(var(--spacing) * 2);}.py-1{padding-block:calc(var(--spacing) * 1);}.py-2{padding-block:calc(var(--spacing) * 2);}.pl-1{padding-left:calc(var(--spacing) * 1);}.pr-4{padding-right:calc(var(--spacing) * 4);}.ps{padding-inline-start:calc(var(--spacing) * 4);}.outline-0{outline-style:var(--un-outline-style);outline-width:0px;}.outline-2{outline-style:var(--un-outline-style);outline-width:2px;}.outline-blue{outline-color:color-mix(in srgb, var(--colors-blue-DEFAULT) var(--un-outline-opacity), transparent) /* oklch(70.7% 0.165 254.624) */;}.b{border-width:1px;}.rd-2{border-radius:0.5rem;}.rd-sm{border-radius:var(--radius-sm);}.bg-\#dafaea{background-color:color-mix(in oklab, #dafaea var(--un-bg-opacity), transparent) /* #dafaea */;}.bg-\#ffe8e8{background-color:color-mix(in oklab, #ffe8e8 var(--un-bg-opacity), transparent) /* #ffe8e8 */;}.bg-\#fff{background-color:color-mix(in oklab, #fff var(--un-bg-opacity), transparent) /* #fff */;}.bg-gray\/20{background-color:color-mix(in srgb, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}.op-75{opacity:75%;}.op40{opacity:40%;}.flex{display:flex;}.flex-shrink-0{flex-shrink:0;}.flex-col{flex-direction:column;}.flex-wrap{flex-wrap:wrap;}.gap-2{gap:calc(var(--spacing) * 2);}.size-4\!{width:calc(var(--spacing) * 4) !important;height:calc(var(--spacing) * 4) !important;}.size-full{width:100%;height:100%;}.h-1\!{height:calc(var(--spacing) * 1) !important;}.h-a\!{height:auto !important;}.h-full{height:100%;}.max-h-100{max-height:calc(var(--spacing) * 100);}.min-h-40{min-height:calc(var(--spacing) * 40);}.min-h-a\!{min-height:auto !important;}.w-10px\!{width:10px !important;}.after\:h-1::after{height:calc(var(--spacing) * 1);}.after\:w-1::after{width:calc(var(--spacing) * 1);}.inline{display:inline;}.block{display:block;}.cursor-s-resize{cursor:s-resize;}.cursor-w-resize{cursor:w-resize;}.resize-none{resize:none;}.select-none{-webkit-user-select:none;user-select:none;}.translate-x-1\/2{--un-translate-x:50%;translate:var(--un-translate-x) var(--un-translate-y);}.transform{transform:var(--un-rotate-x) var(--un-rotate-y) var(--un-rotate-z) var(--un-skew-x) var(--un-skew-y);}.items-center{align-items:center;}.box-border{box-sizing:border-box;}.bottom-0{bottom:calc(var(--spacing) * 0);}.left-0{left:calc(var(--spacing) * 0);}.right-0{right:calc(var(--spacing) * 0);}.top-0{top:calc(var(--spacing) * 0);}.justify-end\!{justify-content:flex-end !important;}.justify-center{justify-content:center;}.absolute{position:absolute;}.fixed{position:fixed;}.relative{position:relative;}.z-1{z-index:1;}.z-9{z-index:9;}.overflow-auto{overflow:auto;}.table{display:table;}.table-cell{display:table-cell;}@supports (color: color-mix(in lab, red, red)){.outline-blue{outline-color:color-mix(in oklab, var(--colors-blue-DEFAULT) var(--un-outline-opacity), transparent) /* oklch(70.7% 0.165 254.624) */;}.bg-gray\/20{background-color:color-mix(in oklab, var(--colors-gray-DEFAULT) 20%, transparent) /* oklch(70.7% 0.022 261.325) */;}}
1
+ @supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--un-bg-opacity:100%;--un-content:"";--un-translate-x:initial;--un-translate-y:initial;--un-translate-z:initial;--un-text-opacity:100%;--un-border-opacity:100%;--un-space-y-reverse:initial;--un-space-x-reverse:initial;--un-outline-style:solid;--un-outline-opacity:100%;--un-leading:initial}}@property --un-leading{syntax:"*";inherits:false}@property --un-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --un-outline-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-bg-opacity{syntax:"<percentage>";inherits:false;initial-value:100%}@property --un-translate-x{syntax:"*";inherits:false;initial-value:0}@property --un-translate-y{syntax:"*";inherits:false;initial-value:0}@property --un-translate-z{syntax:"*";inherits:false;initial-value:0}:root,:host{--spacing:.25rem;--colors-gray-DEFAULT:#99a1af;--text-sm-fontSize:.875rem;--text-sm-lineHeight:1.25rem;--radius-sm:.25rem;--colors-blue-DEFAULT:#54a2ff;--font-sans:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--default-font-family:var(--font-sans);--default-monoFont-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root,:host{--colors-gray-DEFAULT:lab(65.9269% -.832707 -8.17474);--colors-blue-DEFAULT:lab(65.0361% -1.42062 -56.9803)}}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-featureSettings,normal);font-variation-settings:var(--default-font-variationSettings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-monoFont-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-monoFont-featureSettings,normal);font-variation-settings:var(--default-monoFont-variationSettings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden~=until-found])){display:none!important}.container{width:100%}.aic{align-items:center}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.text-3\.5{font-size:.875rem}.lh-\[1\]{--un-leading:1;line-height:1}.m9{margin:36px}.mx-1{margin-inline:4px}.mx-3\!{margin-inline:12px!important}.my-1{margin-block:4px}.ml{margin-left:16px}.ml-\.5{margin-left:2px}.ml-1{margin-left:4px}.mr--1{margin-right:-4px}.mr-1{margin-right:4px}.mr-2{margin-right:8px}.mr-2\.5{margin-right:10px}.p-1{padding:4px}.px,.px-4{padding-inline:16px}.px-2{padding-inline:8px}.py-1{padding-block:4px}.py-2{padding-block:8px}.pl-1{padding-left:4px}.pr-4{padding-right:16px}.ps{padding-inline-start:16px}.outline-0{outline-style:var(--un-outline-style);outline-width:0}.outline-2{outline-style:var(--un-outline-style);outline-width:2px}.outline-blue{outline-color:color-mix(in srgb,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.b{border-width:1px}.rd-2{border-radius:.5rem}.rd-sm{border-radius:var(--radius-sm)}.bg-\#dafaea{background-color:color-mix(in oklab,#dafaea var(--un-bg-opacity),transparent)}.bg-\#ffe8e8{background-color:color-mix(in oklab,#ffe8e8 var(--un-bg-opacity),transparent)}.bg-\#fff{background-color:color-mix(in oklab,#fff var(--un-bg-opacity),transparent)}.bg-gray\/20{background-color:color-mix(in srgb,var(--colors-gray-DEFAULT)20%,transparent)}.op-75{opacity:.75}.op40{opacity:.4}.flex{display:flex}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.gap-2{gap:8px}.size-4\!{width:16px!important;height:16px!important}.size-full{width:100%;height:100%}.h-1\!{height:4px!important}.h-a\!{height:auto!important}.h-full{height:100%}.max-h-100{max-height:400px}.min-h-40{min-height:160px}.min-h-a\!{min-height:auto!important}.w-10px\!{width:10px!important}.after\:h-1:after{height:4px}.after\:w-1:after{width:4px}.inline{display:inline}.block{display:block}.cursor-s-resize{cursor:s-resize}.cursor-w-resize{cursor:w-resize}.resize-none{resize:none}.select-none{-webkit-user-select:none;user-select:none}.translate-x-1\/2{--un-translate-x:50%;translate:var(--un-translate-x)var(--un-translate-y)}.transform{transform:var(--un-rotate-x)var(--un-rotate-y)var(--un-rotate-z)var(--un-skew-x)var(--un-skew-y)}.items-center{align-items:center}.box-border{box-sizing:border-box}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.justify-end\!{justify-content:flex-end!important}.justify-center{justify-content:center}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.z-1{z-index:1}.z-9{z-index:9}.overflow-auto{overflow:auto}.table{display:table}.table-cell{display:table-cell}@supports (color:color-mix(in lab, red, red)){.outline-blue{outline-color:color-mix(in oklab,var(--colors-blue-DEFAULT)var(--un-outline-opacity),transparent)}.bg-gray\/20{background-color:color-mix(in oklab,var(--colors-gray-DEFAULT)20%,transparent)}}
@@ -1,8 +1,6 @@
1
1
  import { spread, template } from "solid-js/web";
2
- var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d="m9 18l6-6l-6-6">`);
3
- var chevron_right_default = (props = {}) => (() => {
4
- var _el$ = _tmpl$();
5
- spread(_el$, props, true, true);
6
- return _el$;
2
+ var _tmpl$ = /* @__PURE__ */ template("<svg viewBox=\"0 0 24 24\"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d=\"m9 18l6-6l-6-6\">"), chevron_right_default = (n = {}) => (() => {
3
+ var r = _tmpl$();
4
+ return spread(r, n, !0, !0), r;
7
5
  })();
8
6
  export { chevron_right_default as default };
@@ -4,101 +4,67 @@ import { createEffect, createMemo, createSignal, mergeProps as mergeProps$1, onC
4
4
  import { clamp, sum } from "es-toolkit";
5
5
  import { createMutationObserver } from "@solid-primitives/mutation-observer";
6
6
  import { createElementBounds } from "@solid-primitives/bounds";
7
- var _tmpl$ = /* @__PURE__ */ template(`<div style=position:absolute;z-index:1>`), _tmpl$2 = /* @__PURE__ */ template(`<div>`), _tmpl$3 = /* @__PURE__ */ template(`<div class=col-hand contenteditable=false>`), _tmpl$4 = /* @__PURE__ */ template(`<div class=dot>`);
8
- const Columns = (attrs) => {
9
- const [_, props] = splitProps(mergeProps$1({ gap: 0 }, attrs), ["children"]);
10
- let ref;
11
- const [children$1, setChildren] = createSignal([]);
12
- const cols = createMemo(() => children$1().length);
13
- const update = () => setChildren([...ref.querySelectorAll("& > [tiptap-is=\"column\"]")]);
14
- onMount(() => update());
15
- createMutationObserver(() => ref, { childList: true }, () => {
16
- update();
17
- container.parentElement || ref.insertBefore(container, ref.firstChild);
7
+ var _tmpl$ = /* @__PURE__ */ template("<div style=position:absolute;z-index:1>"), _tmpl$2 = /* @__PURE__ */ template("<div>"), _tmpl$3 = /* @__PURE__ */ template("<div class=col-hand contenteditable=false>"), _tmpl$4 = /* @__PURE__ */ template("<div class=dot>");
8
+ const Columns = (e) => {
9
+ let [p, h] = splitProps(mergeProps$1({ gap: 0 }, e), ["children"]), g, [v, S] = createSignal([]), C = createMemo(() => v().length), D = () => S([...g.querySelectorAll("& > [tiptap-is=\"column\"]")]);
10
+ onMount(() => D()), createMutationObserver(() => g, { childList: !0 }, () => {
11
+ D(), O.parentElement || g.insertBefore(O, g.firstChild);
18
12
  });
19
- const container = _tmpl$();
20
- const bounds2 = createElementBounds(() => container, { trackScroll: false });
21
- createEffect(() => {
22
- ref.insertBefore(container, ref.firstChild);
23
- onCleanup(() => container.remove());
24
- });
25
- createEffect(() => {
26
- children$1().forEach((el, i) => {
27
- if (i == children$1().length - 1) return;
28
- const dispose = render(() => createComponent(Hand, {
29
- index: i,
13
+ let O = _tmpl$(), k = createElementBounds(() => O, { trackScroll: !1 });
14
+ return createEffect(() => {
15
+ g.insertBefore(O, g.firstChild), onCleanup(() => O.remove());
16
+ }), createEffect(() => {
17
+ v().forEach((e, p) => {
18
+ if (p == v().length - 1) return;
19
+ let g = render(() => createComponent(Hand, {
20
+ index: p,
30
21
  get gap() {
31
- return props.gap;
22
+ return h.gap;
32
23
  },
33
- reference: el,
34
- bounds2,
24
+ reference: e,
25
+ bounds2: k,
35
26
  get onAdd() {
36
- return props.onAdd;
27
+ return h.onAdd;
37
28
  }
38
- }), container);
39
- onCleanup(dispose);
29
+ }), O);
30
+ onCleanup(g);
40
31
  });
41
- const cw = ref.offsetWidth;
42
- const tgap = (cols() - 1) * props.gap;
43
- const meanw = (cw - tgap) / cols();
44
- children$1().forEach((el) => el.style.width ||= `${meanw}px`);
45
- const ws = children$1().map((el) => el.offsetWidth);
46
- const sumw = sum(ws) + tgap;
47
- const sgap = tgap / cols();
48
- children$1().forEach((el, i) => el.style.width = `calc(${(ws[i] + sgap) / sumw * 100}% - ${sgap}px)`);
49
- });
50
- return (() => {
51
- var _el$2 = _tmpl$2();
52
- var _ref$ = ref;
53
- typeof _ref$ === "function" ? use(_ref$, _el$2) : ref = _el$2;
54
- spread(_el$2, mergeProps({ get style() {
55
- return `display: flex; gap: ${props.gap}px;`;
56
- } }, props, { get cols() {
57
- return cols();
58
- } }), false, true);
59
- insert(_el$2, () => attrs.children);
60
- return _el$2;
32
+ let e = g.offsetWidth, p = (C() - 1) * h.gap, _ = (e - p) / C();
33
+ v().forEach((e) => e.style.width ||= `${_}px`);
34
+ let y = v().map((e) => e.offsetWidth), x = sum(y) + p, S = p / C();
35
+ v().forEach((e, p) => e.style.width = `calc(${(y[p] + S) / x * 100}% - ${S}px)`);
36
+ }), (() => {
37
+ var p = _tmpl$2(), m = g;
38
+ return typeof m == "function" ? use(m, p) : g = p, spread(p, mergeProps({ get style() {
39
+ return `display: flex; gap: ${h.gap}px;`;
40
+ } }, h, { get cols() {
41
+ return C();
42
+ } }), !1, !0), insert(p, () => e.children), p;
61
43
  })();
62
44
  };
63
- var Hand = (props) => {
64
- const bounds = createElementBounds(props.reference, { trackScroll: false });
65
- const style$1 = createMemo(() => `
45
+ var Hand = (m) => {
46
+ let h = createElementBounds(m.reference, { trackScroll: !1 }), y = createMemo(() => `
66
47
  position: absolute;
67
- width: ${props.gap}px;
68
- height: ${bounds.height}px;
69
- transform: translate(${bounds.right - props.bounds2.left}px, ${bounds.top - props.bounds2.top}px);
70
- `);
71
- let el;
72
- usePointerDrag(() => el, { start(e, move) {
73
- const col = props.reference;
74
- const container = col.parentElement, cw = container.offsetWidth;
75
- const [cols, gap] = [+container.getAttribute("cols"), +container.getAttribute("gap")];
76
- const [left, right] = [col, col.nextElementSibling];
77
- const [lw, rw] = [left?.offsetWidth || 0, right?.offsetWidth || 0];
78
- const minw = cw * .05, maxw = lw + rw - minw;
79
- const sgap = (cols - 1) * gap / cols;
80
- move((e$1, { ox }) => {
81
- left && (left.style.width = `calc(${(clamp(lw + ox, minw, maxw) + sgap) / cw * 100}% - ${sgap}px)`);
82
- right && (right.style.width = `calc(${(clamp(rw - ox, minw, maxw) + sgap) / cw * 100}% - ${sgap}px)`);
48
+ width: ${m.gap}px;
49
+ height: ${h.height}px;
50
+ transform: translate(${h.right - m.bounds2.left}px, ${h.top - m.bounds2.top}px);
51
+ `), b;
52
+ return usePointerDrag(() => b, { start(e, p) {
53
+ let h = m.reference, g = h.parentElement, _ = g.offsetWidth, [v, y] = [+g.getAttribute("cols"), +g.getAttribute("gap")], [b, x] = [h, h.nextElementSibling], [S, C] = [b?.offsetWidth || 0, x?.offsetWidth || 0], w = _ * .05, T = S + C - w, E = (v - 1) * y / v;
54
+ p((e, { ox: p }) => {
55
+ b && (b.style.width = `calc(${(clamp(S + p, w, T) + E) / _ * 100}% - ${E}px)`), x && (x.style.width = `calc(${(clamp(C - p, w, T) + E) / _ * 100}% - ${E}px)`);
83
56
  });
84
- } });
85
- return (() => {
86
- var _el$3 = _tmpl$3();
87
- var _ref$3 = props.ref;
88
- typeof _ref$3 === "function" ? use(_ref$3, _el$3) : props.ref = _el$3;
89
- var _ref$2 = el;
90
- typeof _ref$2 === "function" ? use(_ref$2, _el$3) : el = _el$3;
91
- insert(_el$3, (() => {
92
- var _c$ = memo(() => !!props.onAdd);
93
- return () => _c$() && (() => {
94
- var _el$4 = _tmpl$4();
95
- addEventListener(_el$4, "pointerdown", { handleEvent: (e) => e.stopPropagation() });
96
- _el$4.$$click = () => props.onAdd(props.index);
97
- return _el$4;
57
+ } }), (() => {
58
+ var e = _tmpl$3(), h = m.ref;
59
+ typeof h == "function" ? use(h, e) : m.ref = e;
60
+ var x = b;
61
+ return typeof x == "function" ? use(x, e) : b = e, insert(e, (() => {
62
+ var e = memo(() => !!m.onAdd);
63
+ return () => e() && (() => {
64
+ var e = _tmpl$4();
65
+ return addEventListener(e, "pointerdown", { handleEvent: (e) => e.stopPropagation() }), e.$$click = () => m.onAdd(m.index), e;
98
66
  })();
99
- })());
100
- effect((_$p) => style(_el$3, style$1(), _$p));
101
- return _el$3;
67
+ })()), effect((p) => style(e, y(), p)), e;
102
68
  })();
103
69
  };
104
70
  delegateEvents(["click"]);
@@ -3,38 +3,30 @@ import { Tree } from "./Tree.js";
3
3
  import { createComponent, insert, spread, template } from "solid-js/web";
4
4
  import { createEffect, createMemo, createSignal, splitProps } from "solid-js";
5
5
  import { delay } from "es-toolkit";
6
- var _tmpl$ = /* @__PURE__ */ template(`<div class=doc-tree>`);
7
- function DocTree(_) {
8
- const [props, attrs] = splitProps(_, ["editor"]);
9
- const [count, setCount] = createSignal(0);
10
- createEffect(() => props.editor.on("update", () => setCount((v) => ++v)));
11
- const json = useMemoAsync(() => (count(), delay(300).then(() => props.editor.getJSON())), {});
12
- const headings = createMemo(() => {
13
- return function walker(node, queue = [], queue2 = []) {
14
- if (node.type === "heading") {
15
- let i = queue.length;
16
- while (i--) if (queue[i].level < node.attrs.level) break;
17
- const item = {
18
- label: node.content?.map((e) => e.text).join(""),
19
- level: node.attrs.level
20
- };
21
- queue.push(item);
22
- if (i > -1) (queue[i].children ??= []).push(item);
23
- else queue2.push(item);
24
- } else node.content?.forEach((e) => walker(e, queue, queue2));
25
- return queue2;
26
- }(json());
27
- });
6
+ var _tmpl$ = /* @__PURE__ */ template("<div class=doc-tree>");
7
+ function DocTree(d) {
8
+ let [f, p] = splitProps(d, ["editor"]), [m, h] = createSignal(0);
9
+ createEffect(() => f.editor.on("update", () => h((e) => ++e)));
10
+ let g = useMemoAsync(() => (m(), delay(300).then(() => f.editor.getJSON())), {}), _ = createMemo(() => function e(s, c = [], l = []) {
11
+ if (s.type === "heading") {
12
+ let e = c.length;
13
+ for (; e-- && !(c[e].level < s.attrs.level););
14
+ let u = {
15
+ label: s.content?.map((e) => e.text).join(""),
16
+ level: s.attrs.level
17
+ };
18
+ c.push(u), e > -1 ? (c[e].children ??= []).push(u) : l.push(u);
19
+ } else s.content?.forEach((s) => e(s, c, l));
20
+ return l;
21
+ }(g()));
28
22
  return (() => {
29
- var _el$ = _tmpl$();
30
- spread(_el$, attrs, false, true);
31
- insert(_el$, createComponent(Tree, {
23
+ var e = _tmpl$();
24
+ return spread(e, p, !1, !0), insert(e, createComponent(Tree, {
32
25
  get data() {
33
- return headings();
26
+ return _();
34
27
  },
35
- "class": "min-h-40 max-h-100 overflow-auto"
36
- }));
37
- return _el$;
28
+ class: "min-h-40 max-h-100 overflow-auto"
29
+ })), e;
38
30
  })();
39
31
  }
40
32
  export { DocTree };
@@ -12,119 +12,95 @@ import { delay } from "es-toolkit";
12
12
  import { pointerHover } from "@solid-primitives/pointer";
13
13
  import { isEmpty } from "es-toolkit/compat";
14
14
  import { autoUpdate, createFloating, offset } from "floating-ui-solid";
15
- var _tmpl$ = /* @__PURE__ */ template(`<div><div>`), _tmpl$2 = /* @__PURE__ */ template(`<div>`), _tmpl$3 = /* @__PURE__ */ template(`<div class="px-4 py-2 op40">无内容`);
16
- function Menu(props) {
17
- const MenuCtx = createContext({ deep: 0 });
18
- const _Li = (_e) => {
19
- const ctx = useContext(MenuCtx);
20
- const [e, attrs] = splitProps(_e, [
21
- "children",
22
- "label",
23
- "icon",
24
- "isActive",
25
- "cb",
26
- "menu",
27
- "popover"
28
- ]);
29
- const x = createMemo(() => props.x && ctx.deep == 1);
30
- let el;
31
- const [floating, setFloating] = createSignal();
32
- const [hover, setHover] = useSignle2(false, { before: () => delay(100) });
33
- const style$1 = createMemo(() => floating() ? createFloating({
34
- strategy: "fixed",
35
- placement: x() ? "bottom-start" : "right-start",
36
- ...e.menu,
37
- elements: {
38
- reference: () => el,
39
- floating
40
- },
41
- whileElementsMounted(ref, float, update) {
42
- return autoUpdate(ref, float, update, {
43
- ancestorResize: true,
44
- elementResize: true,
45
- layoutShift: true,
46
- ancestorScroll: true
47
- });
48
- }
49
- }).floatingStyles : void 0);
50
- createEffect(() => {
51
- floating() && Object.assign(floating().style, style$1()?.() ?? {});
52
- });
53
- const req = createMutable({ loading: false });
54
- async function onClick() {
55
- if (req.loading) return;
56
- const ret = e.cb?.();
57
- if (ret instanceof Promise) try {
58
- await ret;
59
- req.loading = true;
60
- } finally {
61
- req.loading = false;
62
- props.onAction?.(e);
63
- }
64
- else props.onAction?.(e);
65
- }
66
- onMount(() => {
67
- createComponent(Popover, mergeProps({
15
+ var _tmpl$ = /* @__PURE__ */ template("<div><div>"), _tmpl$2 = /* @__PURE__ */ template("<div>"), _tmpl$3 = /* @__PURE__ */ template("<div class=\"px-4 py-2 op40\">无内容");
16
+ function Menu(k) {
17
+ let P = createContext({ deep: 0 }), F = createRender({
18
+ is: (D) => {
19
+ let O = useContext(P), [A, j] = splitProps(D, [
20
+ "children",
21
+ "label",
22
+ "icon",
23
+ "isActive",
24
+ "cb",
25
+ "menu",
26
+ "popover"
27
+ ]), M = createMemo(() => k.x && O.deep == 1), N, [F, L] = createSignal(), [R, z] = useSignle2(!1, { before: () => delay(100) }), B = createMemo(() => F() ? createFloating({
68
28
  strategy: "fixed",
69
- reference: el,
70
- portal: el
71
- }, () => _e.popover, { get middleware() {
72
- return [offset({ mainAxis: 4 })];
73
- } }));
74
- });
75
- children(() => e.children);
76
- return (() => {
77
- var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
78
- use(pointerHover, _el$, () => setHover);
79
- var _ref$ = el;
80
- typeof _ref$ === "function" ? use(_ref$, _el$) : el = _el$;
81
- spread(_el$, mergeProps(() => combineProps({ class: `li flex aic rd-2 ${x() ? "my-1 p-1" : "mx-1 pl-1 pr-4 py-1"} ${unFn(e.isActive) && "active"}` }, attrs), { "on:click": onClick }), false, true);
82
- insert(_el$2, (() => {
83
- var _c$ = memo(() => !!req.loading);
84
- return () => _c$() ? createComponent(loading_default, {}) : e.icon;
85
- })());
86
- insert(_el$, () => e.label, null);
87
- insert(_el$, (() => {
88
- var _c$2 = memo(() => !!(hover() && e.children));
89
- return () => _c$2() && createComponent(_Menu, {
90
- ref: setFloating,
91
- "class": "z-1",
92
- get children() {
93
- return e.children;
94
- }
95
- });
96
- })(), null);
97
- effect(() => className(_el$2, `flex aic ${x() ? "" : props.density == "comfortable" ? "ml-1 mr-2.5" : "ml-.5 mr-1"} `));
98
- return _el$;
99
- })();
100
- };
101
- const Li = createRender({
102
- is: _Li,
103
- processProps: (props$1) => {
104
- let i = 0;
105
- Array.isArray(props$1.children) && props$1.children.forEach((e) => !e.is && typeof e == "object" && (e["data-index"] = i++));
106
- return props$1;
29
+ placement: M() ? "bottom-start" : "right-start",
30
+ ...A.menu,
31
+ elements: {
32
+ reference: () => N,
33
+ floating: F
34
+ },
35
+ whileElementsMounted(i, E, D) {
36
+ return autoUpdate(i, E, D, {
37
+ ancestorResize: !0,
38
+ elementResize: !0,
39
+ layoutShift: !0,
40
+ ancestorScroll: !0
41
+ });
42
+ }
43
+ }).floatingStyles : void 0);
44
+ createEffect(() => {
45
+ F() && Object.assign(F().style, B()?.() ?? {});
46
+ });
47
+ let V = createMutable({ loading: !1 });
48
+ async function H() {
49
+ if (V.loading) return;
50
+ let i = A.cb?.();
51
+ if (i instanceof Promise) try {
52
+ await i, V.loading = !0;
53
+ } finally {
54
+ V.loading = !1, k.onAction?.(A);
55
+ }
56
+ else k.onAction?.(A);
57
+ }
58
+ return onMount(() => {
59
+ createComponent(Popover, mergeProps({
60
+ strategy: "fixed",
61
+ reference: N,
62
+ portal: N
63
+ }, () => D.popover, { get middleware() {
64
+ return [offset({ mainAxis: 4 })];
65
+ } }));
66
+ }), children(() => A.children), (() => {
67
+ var E = _tmpl$(), D = E.firstChild;
68
+ use(pointerHover, E, () => z);
69
+ var O = N;
70
+ return typeof O == "function" ? use(O, E) : N = E, spread(E, mergeProps(() => combineProps({ class: `li flex aic rd-2 ${M() ? "my-1 p-1" : "mx-1 pl-1 pr-4 py-1"} ${unFn(A.isActive) && "active"}` }, j), { "on:click": H }), !1, !0), insert(D, (() => {
71
+ var i = memo(() => !!V.loading);
72
+ return () => i() ? createComponent(loading_default, {}) : A.icon;
73
+ })()), insert(E, () => A.label, null), insert(E, (() => {
74
+ var i = memo(() => !!(R() && A.children));
75
+ return () => i() && createComponent(I, {
76
+ ref: L,
77
+ class: "z-1",
78
+ get children() {
79
+ return A.children;
80
+ }
81
+ });
82
+ })(), null), effect(() => className(D, `flex aic ${M() ? "" : k.density == "comfortable" ? "ml-1 mr-2.5" : "ml-.5 mr-1"} `)), E;
83
+ })();
84
+ },
85
+ processProps: (i) => {
86
+ let E = 0;
87
+ return Array.isArray(i.children) && i.children.forEach((i) => !i.is && typeof i == "object" && (i["data-index"] = E++)), i;
107
88
  }
108
- });
109
- const _Menu = (e) => {
110
- const parent = useContext(MenuCtx);
111
- const ctx = createMutable({ deep: parent.deep + 1 });
112
- return createComponent(MenuCtx.Provider, {
113
- value: ctx,
89
+ }), I = (i) => {
90
+ let E = useContext(P), D = createMutable({ deep: E.deep + 1 });
91
+ return createComponent(P.Provider, {
92
+ value: D,
114
93
  get children() {
115
- var _el$3 = _tmpl$2();
116
- use(VDir, _el$3, () => e.usedir);
117
- spread(_el$3, mergeProps(() => combineProps({ class: `${props.x && ctx.deep == 1 ? "tt-menu-x flex" : "tt-menu max-h-100"} overflow-auto` }, e), { "on:click": (e$1) => e$1.stopPropagation() }), false, true);
118
- insert(_el$3, () => ((el) => isEmpty(el) ? _tmpl$3() : el)(e.children));
119
- return _el$3;
94
+ var E = _tmpl$2();
95
+ return use(VDir, E, () => i.usedir), spread(E, mergeProps(() => combineProps({ class: `${k.x && D.deep == 1 ? "tt-menu-x flex" : "tt-menu max-h-100"} overflow-auto` }, i), { "on:click": (i) => i.stopPropagation() }), !1, !0), insert(E, () => ((i) => isEmpty(i) ? _tmpl$3() : i)(i.children)), E;
120
96
  }
121
97
  });
122
98
  };
123
- return createComponent(Li, mergeProps(() => combineProps({}, props), {
124
- is: _Menu,
99
+ return createComponent(F, mergeProps(() => combineProps({}, k), {
100
+ is: I,
125
101
  items: null,
126
102
  get children() {
127
- return props.items;
103
+ return k.items;
128
104
  }
129
105
  }));
130
106
  }
@@ -3,47 +3,39 @@ import { Portal, createComponent, memo, mergeProps } from "solid-js/web";
3
3
  import { children, createEffect, createMemo, splitProps } from "solid-js";
4
4
  import { delay } from "es-toolkit";
5
5
  import { autoUpdate, createFloating } from "floating-ui-solid";
6
- function Popover(attrs) {
7
- const [_, props] = splitProps(attrs, ["reference", "floating"]);
8
- const show = (attrs.trigger == "click" ? useClicked : useHover)(() => [reference(), floating()].filter((e) => e));
9
- const show2 = useMemoAsync(() => attrs.trigger == "click" ? show() : show() ? delay(100).then(() => true) : delay(200).then(() => false));
10
- const reference = children(() => attrs.reference);
11
- const floating = children(() => show2() ? attrs.floating : void 0);
12
- return createComponent(Floating, mergeProps(props, {
13
- reference,
14
- floating
6
+ function Popover(s) {
7
+ let [c, u] = splitProps(s, ["reference", "floating"]), d = (s.trigger == "click" ? useClicked : useHover)(() => [m(), h()].filter((e) => e)), p = useMemoAsync(() => s.trigger == "click" ? d() : d() ? delay(100).then(() => !0) : delay(200).then(() => !1)), m = children(() => s.reference), h = children(() => p() ? s.floating : void 0);
8
+ return createComponent(Floating, mergeProps(u, {
9
+ reference: m,
10
+ floating: h
15
11
  }));
16
12
  }
17
- function Floating(attrs) {
18
- const [_, props] = splitProps(attrs, ["reference", "floating"]);
19
- const reference = children(() => attrs.reference);
20
- const floating = children(() => attrs.floating);
21
- const style$1 = createMemo(() => floating() ? createFloating({
22
- whileElementsMounted(ref, float, update) {
23
- return autoUpdate(ref, float, update, {
24
- ancestorResize: true,
25
- elementResize: true,
26
- layoutShift: true,
27
- ancestorScroll: true,
28
- ...attrs.update
13
+ function Floating(e) {
14
+ let [a, o] = splitProps(e, ["reference", "floating"]), l = children(() => e.reference), f = children(() => e.floating), h = createMemo(() => f() ? createFloating({
15
+ whileElementsMounted(a, o, s) {
16
+ return autoUpdate(a, o, s, {
17
+ ancestorResize: !0,
18
+ elementResize: !0,
19
+ layoutShift: !0,
20
+ ancestorScroll: !0,
21
+ ...e.update
29
22
  });
30
23
  },
31
- ...props,
24
+ ...o,
32
25
  elements: {
33
- reference,
34
- floating
26
+ reference: l,
27
+ floating: f
35
28
  }
36
29
  }).floatingStyles : void 0);
37
- createEffect(() => {
38
- floating() && Object.assign(floating().style, style$1()?.() ?? {});
39
- });
40
- return [memo(reference), memo(() => memo(() => !!(props.portal && floating()))() ? createComponent(Portal, {
30
+ return createEffect(() => {
31
+ f() && Object.assign(f().style, h()?.() ?? {});
32
+ }), [memo(l), memo(() => memo(() => !!(o.portal && f()))() ? createComponent(Portal, {
41
33
  get mount() {
42
- return props.portal;
34
+ return o.portal;
43
35
  },
44
36
  get children() {
45
- return floating();
37
+ return f();
46
38
  }
47
- }) : floating())];
39
+ }) : f())];
48
40
  }
49
41
  export { Floating, Popover };
@@ -1,21 +1,20 @@
1
1
  import { Dynamic, createComponent, memo, mergeProps } from "solid-js/web";
2
2
  import { splitProps } from "solid-js";
3
- var unFn = (fn, ...arg) => typeof fn == "function" ? fn(...arg) : fn;
4
- function createRender({ is, processProps = (e) => e } = {}) {
5
- const Render$1 = (props) => {
6
- const [reserve, attrs] = splitProps(processProps?.(props), [
3
+ var unFn = (e, ...a) => typeof e == "function" ? e(...a) : e;
4
+ function createRender({ is: o, processProps: s = (e) => e } = {}) {
5
+ let c = (c) => {
6
+ let [u, d] = splitProps(s?.(c), [
7
7
  "is",
8
8
  "vIf",
9
9
  "children"
10
10
  ]);
11
- return memo(() => memo(() => !!(!("vIf" in reserve) || !!unFn(reserve.vIf)))() && createComponent(Dynamic, mergeProps({ get component() {
12
- return reserve.is ?? is;
13
- } }, attrs, { get children() {
14
- return List(reserve.children);
11
+ return memo(() => memo(() => !!(!("vIf" in u) || unFn(u.vIf)))() && createComponent(Dynamic, mergeProps({ get component() {
12
+ return u.is ?? o;
13
+ } }, d, { get children() {
14
+ return l(u.children);
15
15
  } })));
16
- };
17
- const List = (children$1) => Array.isArray(children$1) ? children$1.map((e) => typeof e == "object" ? Render$1(e) : e) : children$1;
18
- return Render$1;
16
+ }, l = (e) => Array.isArray(e) ? e.map((e) => typeof e == "object" ? c(e) : e) : e;
17
+ return c;
19
18
  }
20
19
  const Render = createRender({ is: "div" });
21
20
  export { Render, createRender };