@verbb/plugin-kit-web 2.0.0
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/CHANGELOG.md +16 -0
- package/LICENSE.md +21 -0
- package/README.md +149 -0
- package/dist/a11y/active-elements.d.ts +6 -0
- package/dist/a11y/active-elements.d.ts.map +1 -0
- package/dist/a11y/dismissible-stack.d.ts +6 -0
- package/dist/a11y/dismissible-stack.d.ts.map +1 -0
- package/dist/a11y/focus.d.ts +20 -0
- package/dist/a11y/focus.d.ts.map +1 -0
- package/dist/a11y/index.d.ts +7 -0
- package/dist/a11y/index.d.ts.map +1 -0
- package/dist/a11y/offset.d.ts +9 -0
- package/dist/a11y/offset.d.ts.map +1 -0
- package/dist/a11y/scroll-lock.d.ts +23 -0
- package/dist/a11y/scroll-lock.d.ts.map +1 -0
- package/dist/base/checkbox-control.styles.d.ts +3 -0
- package/dist/base/checkbox-control.styles.d.ts.map +1 -0
- package/dist/base/component-id.d.ts +2 -0
- package/dist/base/component-id.d.ts.map +1 -0
- package/dist/base/form-control.styles.d.ts +3 -0
- package/dist/base/form-control.styles.d.ts.map +1 -0
- package/dist/base/icon.styles.d.ts +3 -0
- package/dist/base/icon.styles.d.ts.map +1 -0
- package/dist/base/markdown.styles.d.ts +3 -0
- package/dist/base/markdown.styles.d.ts.map +1 -0
- package/dist/base/pk-element.d.ts +28 -0
- package/dist/base/pk-element.d.ts.map +1 -0
- package/dist/base/pk-form-associated-element.d.ts +63 -0
- package/dist/base/pk-form-associated-element.d.ts.map +1 -0
- package/dist/base/shadow-reset.styles.d.ts +6 -0
- package/dist/base/shadow-reset.styles.d.ts.map +1 -0
- package/dist/base/styles.d.ts +9 -0
- package/dist/base/styles.d.ts.map +1 -0
- package/dist/chunks/active-elements-BwpXu8Lb.js +16 -0
- package/dist/chunks/active-elements-BwpXu8Lb.js.map +1 -0
- package/dist/chunks/animate-with-class-CsDwYnXL.js +42 -0
- package/dist/chunks/animate-with-class-CsDwYnXL.js.map +1 -0
- package/dist/chunks/autoloader-DzOTQqe6.js +177 -0
- package/dist/chunks/autoloader-DzOTQqe6.js.map +1 -0
- package/dist/chunks/button-group-item.styles-DYmBR28a.js +147 -0
- package/dist/chunks/button-group-item.styles-DYmBR28a.js.map +1 -0
- package/dist/chunks/component-registry-CpZiIDh4.js +130 -0
- package/dist/chunks/component-registry-CpZiIDh4.js.map +1 -0
- package/dist/chunks/control-aria-B2QMq4ji.js +69 -0
- package/dist/chunks/control-aria-B2QMq4ji.js.map +1 -0
- package/dist/chunks/decorate-W02hmVTt.js +149 -0
- package/dist/chunks/decorate-W02hmVTt.js.map +1 -0
- package/dist/chunks/dismissible-stack-XQUMfKO3.js +32 -0
- package/dist/chunks/dismissible-stack-XQUMfKO3.js.map +1 -0
- package/dist/chunks/field-labels-CoU9dnNq.js +14 -0
- package/dist/chunks/field-labels-CoU9dnNq.js.map +1 -0
- package/dist/chunks/focus-aa5dlv8k.js +122 -0
- package/dist/chunks/focus-aa5dlv8k.js.map +1 -0
- package/dist/chunks/form-control.styles-BQdimE5o.js +108 -0
- package/dist/chunks/form-control.styles-BQdimE5o.js.map +1 -0
- package/dist/chunks/has-slot-8BvCt_qo.js +74 -0
- package/dist/chunks/has-slot-8BvCt_qo.js.map +1 -0
- package/dist/chunks/icon.styles-BLTWLqYp.js +21 -0
- package/dist/chunks/icon.styles-BLTWLqYp.js.map +1 -0
- package/dist/chunks/icons-BR8JcQj2.js +52 -0
- package/dist/chunks/icons-BR8JcQj2.js.map +1 -0
- package/dist/chunks/mirror-validator-DCjNYrrx.js +32 -0
- package/dist/chunks/mirror-validator-DCjNYrrx.js.map +1 -0
- package/dist/chunks/overlay-lifecycle-D0pkTQyI.js +44 -0
- package/dist/chunks/overlay-lifecycle-D0pkTQyI.js.map +1 -0
- package/dist/chunks/pk-button-Cilu5WAT.js +840 -0
- package/dist/chunks/pk-button-Cilu5WAT.js.map +1 -0
- package/dist/chunks/pk-button-group-D9hqSfb_.js +422 -0
- package/dist/chunks/pk-button-group-D9hqSfb_.js.map +1 -0
- package/dist/chunks/pk-button-group-separator-DG0CYaqc.js +61 -0
- package/dist/chunks/pk-button-group-separator-DG0CYaqc.js.map +1 -0
- package/dist/chunks/pk-button-group-text-C5z4P7ur.js +49 -0
- package/dist/chunks/pk-button-group-text-C5z4P7ur.js.map +1 -0
- package/dist/chunks/pk-calendar-CcV-La-9.js +1410 -0
- package/dist/chunks/pk-calendar-CcV-La-9.js.map +1 -0
- package/dist/chunks/pk-checkbox-Bavq3-9C.js +360 -0
- package/dist/chunks/pk-checkbox-Bavq3-9C.js.map +1 -0
- package/dist/chunks/pk-checkbox-select-ZEJ6WIQn.js +221 -0
- package/dist/chunks/pk-checkbox-select-ZEJ6WIQn.js.map +1 -0
- package/dist/chunks/pk-clear--mPWZP7H.js +15 -0
- package/dist/chunks/pk-clear--mPWZP7H.js.map +1 -0
- package/dist/chunks/pk-code-editor-DSG6AwLV.js +213 -0
- package/dist/chunks/pk-code-editor-DSG6AwLV.js.map +1 -0
- package/dist/chunks/pk-color-input-D4L0DE5S.js +398 -0
- package/dist/chunks/pk-color-input-D4L0DE5S.js.map +1 -0
- package/dist/chunks/pk-combobox-Dd1ik0Ko.js +2015 -0
- package/dist/chunks/pk-combobox-Dd1ik0Ko.js.map +1 -0
- package/dist/chunks/pk-copy-button-DPh5TOF9.js +139 -0
- package/dist/chunks/pk-copy-button-DPh5TOF9.js.map +1 -0
- package/dist/chunks/pk-date-picker-CkwU4DzD.js +717 -0
- package/dist/chunks/pk-date-picker-CkwU4DzD.js.map +1 -0
- package/dist/chunks/pk-dialog-DZZd1Tzb.js +636 -0
- package/dist/chunks/pk-dialog-DZZd1Tzb.js.map +1 -0
- package/dist/chunks/pk-dropdown-item-BFyjtsL5.js +547 -0
- package/dist/chunks/pk-dropdown-item-BFyjtsL5.js.map +1 -0
- package/dist/chunks/pk-dropdown-label-DfACId-K.js +48 -0
- package/dist/chunks/pk-dropdown-label-DfACId-K.js.map +1 -0
- package/dist/chunks/pk-dropdown-menu-DWlxkDIs.js +735 -0
- package/dist/chunks/pk-dropdown-menu-DWlxkDIs.js.map +1 -0
- package/dist/chunks/pk-editable-table-pBkD6izs.js +1528 -0
- package/dist/chunks/pk-editable-table-pBkD6izs.js.map +1 -0
- package/dist/chunks/pk-field-Buy_AtYF.js +485 -0
- package/dist/chunks/pk-field-Buy_AtYF.js.map +1 -0
- package/dist/chunks/pk-form-associated-element-DmZKgNPL.js +260 -0
- package/dist/chunks/pk-form-associated-element-DmZKgNPL.js.map +1 -0
- package/dist/chunks/pk-input-group-CGHQKrt8.js +238 -0
- package/dist/chunks/pk-input-group-CGHQKrt8.js.map +1 -0
- package/dist/chunks/pk-input-group-addon-DXbNbsfY.js +101 -0
- package/dist/chunks/pk-input-group-addon-DXbNbsfY.js.map +1 -0
- package/dist/chunks/pk-input-group-button-XOfVLqGO.js +55 -0
- package/dist/chunks/pk-input-group-button-XOfVLqGO.js.map +1 -0
- package/dist/chunks/pk-input-group-input-CSmR5vdY.js +136 -0
- package/dist/chunks/pk-input-group-input-CSmR5vdY.js.map +1 -0
- package/dist/chunks/pk-input-group-text-C6ekhtff.js +40 -0
- package/dist/chunks/pk-input-group-text-C6ekhtff.js.map +1 -0
- package/dist/chunks/pk-input-group-textarea-DALr3pdU.js +113 -0
- package/dist/chunks/pk-input-group-textarea-DALr3pdU.js.map +1 -0
- package/dist/chunks/pk-input-naIRPWGC.js +723 -0
- package/dist/chunks/pk-input-naIRPWGC.js.map +1 -0
- package/dist/chunks/pk-lightswitch-B-rLflNq.js +432 -0
- package/dist/chunks/pk-lightswitch-B-rLflNq.js.map +1 -0
- package/dist/chunks/pk-option-C3Zqmu3z.js +312 -0
- package/dist/chunks/pk-option-C3Zqmu3z.js.map +1 -0
- package/dist/chunks/pk-option-group-CbI56A3T.js +72 -0
- package/dist/chunks/pk-option-group-CbI56A3T.js.map +1 -0
- package/dist/chunks/pk-popover-XZZdJ4WI.js +377 -0
- package/dist/chunks/pk-popover-XZZdJ4WI.js.map +1 -0
- package/dist/chunks/pk-popup-CgiXok-U.js +538 -0
- package/dist/chunks/pk-popup-CgiXok-U.js.map +1 -0
- package/dist/chunks/pk-radio-Bg02ckzC.js +233 -0
- package/dist/chunks/pk-radio-Bg02ckzC.js.map +1 -0
- package/dist/chunks/pk-radio-group-B5rps9G4.js +253 -0
- package/dist/chunks/pk-radio-group-B5rps9G4.js.map +1 -0
- package/dist/chunks/pk-scroll-area-B0V4Dr2j.js +402 -0
- package/dist/chunks/pk-scroll-area-B0V4Dr2j.js.map +1 -0
- package/dist/chunks/pk-select-B17rV6BR.js +1129 -0
- package/dist/chunks/pk-select-B17rV6BR.js.map +1 -0
- package/dist/chunks/pk-separator-CLb9n0FK.js +89 -0
- package/dist/chunks/pk-separator-CLb9n0FK.js.map +1 -0
- package/dist/chunks/pk-spinner-Blxd3SIH.js +148 -0
- package/dist/chunks/pk-spinner-Blxd3SIH.js.map +1 -0
- package/dist/chunks/pk-status-7_5dEuw-.js +92 -0
- package/dist/chunks/pk-status-7_5dEuw-.js.map +1 -0
- package/dist/chunks/pk-tab-CzV7pOdp.js +259 -0
- package/dist/chunks/pk-tab-CzV7pOdp.js.map +1 -0
- package/dist/chunks/pk-tab-heading-BWAB85ua.js +50 -0
- package/dist/chunks/pk-tab-heading-BWAB85ua.js.map +1 -0
- package/dist/chunks/pk-tab-panel-Q3Pqyq-f.js +86 -0
- package/dist/chunks/pk-tab-panel-Q3Pqyq-f.js.map +1 -0
- package/dist/chunks/pk-tabs-Cip4nbb7.js +622 -0
- package/dist/chunks/pk-tabs-Cip4nbb7.js.map +1 -0
- package/dist/chunks/pk-textarea-BEapC8Rk.js +342 -0
- package/dist/chunks/pk-textarea-BEapC8Rk.js.map +1 -0
- package/dist/chunks/pk-time-picker-DbW_hMs2.js +228 -0
- package/dist/chunks/pk-time-picker-DbW_hMs2.js.map +1 -0
- package/dist/chunks/pk-tiptap-content-DAtNbJYC.js +76 -0
- package/dist/chunks/pk-tiptap-content-DAtNbJYC.js.map +1 -0
- package/dist/chunks/pk-tiptap-editor-umIuEaXh.js +1084 -0
- package/dist/chunks/pk-tiptap-editor-umIuEaXh.js.map +1 -0
- package/dist/chunks/pk-tiptap-input-CXcYXbRa.js +250 -0
- package/dist/chunks/pk-tiptap-input-CXcYXbRa.js.map +1 -0
- package/dist/chunks/pk-toggle-5-GKVLye.js +256 -0
- package/dist/chunks/pk-toggle-5-GKVLye.js.map +1 -0
- package/dist/chunks/pk-toggle-group-CWDwYlgR.js +175 -0
- package/dist/chunks/pk-toggle-group-CWDwYlgR.js.map +1 -0
- package/dist/chunks/pk-tooltip-fcUbVGli.js +469 -0
- package/dist/chunks/pk-tooltip-fcUbVGli.js.map +1 -0
- package/dist/chunks/popup-content-animation.styles-Dc6d9quJ.js +117 -0
- package/dist/chunks/popup-content-animation.styles-Dc6d9quJ.js.map +1 -0
- package/dist/chunks/popup-placement-animation-WlEXnS85.js +60 -0
- package/dist/chunks/popup-placement-animation-WlEXnS85.js.map +1 -0
- package/dist/chunks/popup-pointer-C8lypj8V.js +21 -0
- package/dist/chunks/popup-pointer-C8lypj8V.js.map +1 -0
- package/dist/chunks/register-components-DNw6EYNo.js +15 -0
- package/dist/chunks/register-components-DNw6EYNo.js.map +1 -0
- package/dist/chunks/render-Dvc3MHQR.js +16 -0
- package/dist/chunks/render-Dvc3MHQR.js.map +1 -0
- package/dist/chunks/required-validator-CEg8dvjS.js +29 -0
- package/dist/chunks/required-validator-CEg8dvjS.js.map +1 -0
- package/dist/chunks/scroll-lock-B4o9vdzJ.js +193 -0
- package/dist/chunks/scroll-lock-B4o9vdzJ.js.map +1 -0
- package/dist/chunks/spinner-utils-CDfHypTv.js +15 -0
- package/dist/chunks/spinner-utils-CDfHypTv.js.map +1 -0
- package/dist/chunks/supports-popover-CUBsbHpS.js +7 -0
- package/dist/chunks/supports-popover-CUBsbHpS.js.map +1 -0
- package/dist/chunks/sync-listbox-separators-B1-V0oJi.js +149 -0
- package/dist/chunks/sync-listbox-separators-B1-V0oJi.js.map +1 -0
- package/dist/chunks/tiptap.styles-BytOpP0H.js +463 -0
- package/dist/chunks/tiptap.styles-BytOpP0H.js.map +1 -0
- package/dist/component-registry.d.ts +28 -0
- package/dist/component-registry.d.ts.map +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/button/pk-button.d.ts +91 -0
- package/dist/components/button/pk-button.d.ts.map +1 -0
- package/dist/components/button/pk-button.js +2 -0
- package/dist/components/button/pk-button.styles.d.ts +2 -0
- package/dist/components/button/pk-button.styles.d.ts.map +1 -0
- package/dist/components/button-group/button-group-item.styles.d.ts +13 -0
- package/dist/components/button-group/button-group-item.styles.d.ts.map +1 -0
- package/dist/components/button-group/index.d.ts +4 -0
- package/dist/components/button-group/index.d.ts.map +1 -0
- package/dist/components/button-group/pk-button-group-separator.d.ts +18 -0
- package/dist/components/button-group/pk-button-group-separator.d.ts.map +1 -0
- package/dist/components/button-group/pk-button-group-separator.js +2 -0
- package/dist/components/button-group/pk-button-group-separator.styles.d.ts +2 -0
- package/dist/components/button-group/pk-button-group-separator.styles.d.ts.map +1 -0
- package/dist/components/button-group/pk-button-group-text.d.ts +18 -0
- package/dist/components/button-group/pk-button-group-text.d.ts.map +1 -0
- package/dist/components/button-group/pk-button-group-text.js +2 -0
- package/dist/components/button-group/pk-button-group-text.styles.d.ts +2 -0
- package/dist/components/button-group/pk-button-group-text.styles.d.ts.map +1 -0
- package/dist/components/button-group/pk-button-group.d.ts +40 -0
- package/dist/components/button-group/pk-button-group.d.ts.map +1 -0
- package/dist/components/button-group/pk-button-group.js +2 -0
- package/dist/components/button-group/pk-button-group.styles.d.ts +2 -0
- package/dist/components/button-group/pk-button-group.styles.d.ts.map +1 -0
- package/dist/components/button-group.d.ts +2 -0
- package/dist/components/button-group.js +4 -0
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.js +2 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/pk-calendar.d.ts +117 -0
- package/dist/components/calendar/pk-calendar.d.ts.map +1 -0
- package/dist/components/calendar/pk-calendar.js +2 -0
- package/dist/components/calendar/pk-calendar.styles.d.ts +2 -0
- package/dist/components/calendar/pk-calendar.styles.d.ts.map +1 -0
- package/dist/components/calendar.d.ts +2 -0
- package/dist/components/calendar.js +2 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.d.ts.map +1 -0
- package/dist/components/checkbox/pk-checkbox.d.ts +50 -0
- package/dist/components/checkbox/pk-checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/pk-checkbox.js +2 -0
- package/dist/components/checkbox/pk-checkbox.styles.d.ts +2 -0
- package/dist/components/checkbox/pk-checkbox.styles.d.ts.map +1 -0
- package/dist/components/checkbox-select/index.d.ts +2 -0
- package/dist/components/checkbox-select/index.d.ts.map +1 -0
- package/dist/components/checkbox-select/pk-checkbox-select.d.ts +48 -0
- package/dist/components/checkbox-select/pk-checkbox-select.d.ts.map +1 -0
- package/dist/components/checkbox-select/pk-checkbox-select.js +2 -0
- package/dist/components/checkbox-select/pk-checkbox-select.styles.d.ts +2 -0
- package/dist/components/checkbox-select/pk-checkbox-select.styles.d.ts.map +1 -0
- package/dist/components/checkbox-select.d.ts +2 -0
- package/dist/components/checkbox-select.js +2 -0
- package/dist/components/checkbox.d.ts +2 -0
- package/dist/components/checkbox.js +2 -0
- package/dist/components/code-editor/index.d.ts +2 -0
- package/dist/components/code-editor/index.d.ts.map +1 -0
- package/dist/components/code-editor/pk-code-editor.d.ts +40 -0
- package/dist/components/code-editor/pk-code-editor.d.ts.map +1 -0
- package/dist/components/code-editor/pk-code-editor.js +2 -0
- package/dist/components/code-editor/pk-code-editor.styles.d.ts +2 -0
- package/dist/components/code-editor/pk-code-editor.styles.d.ts.map +1 -0
- package/dist/components/code-editor.d.ts +2 -0
- package/dist/components/code-editor.js +2 -0
- package/dist/components/color-input/index.d.ts +2 -0
- package/dist/components/color-input/index.d.ts.map +1 -0
- package/dist/components/color-input/pk-color-input.d.ts +41 -0
- package/dist/components/color-input/pk-color-input.d.ts.map +1 -0
- package/dist/components/color-input/pk-color-input.js +2 -0
- package/dist/components/color-input/pk-color-input.styles.d.ts +7 -0
- package/dist/components/color-input/pk-color-input.styles.d.ts.map +1 -0
- package/dist/components/color-input.d.ts +2 -0
- package/dist/components/color-input.js +2 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/index.d.ts.map +1 -0
- package/dist/components/combobox/pk-combobox.d.ts +219 -0
- package/dist/components/combobox/pk-combobox.d.ts.map +1 -0
- package/dist/components/combobox/pk-combobox.js +2 -0
- package/dist/components/combobox/pk-combobox.styles.d.ts +2 -0
- package/dist/components/combobox/pk-combobox.styles.d.ts.map +1 -0
- package/dist/components/combobox.d.ts +2 -0
- package/dist/components/combobox.js +2 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/copy-button/index.d.ts.map +1 -0
- package/dist/components/copy-button/pk-copy-button.d.ts +37 -0
- package/dist/components/copy-button/pk-copy-button.d.ts.map +1 -0
- package/dist/components/copy-button/pk-copy-button.js +2 -0
- package/dist/components/copy-button/pk-copy-button.styles.d.ts +2 -0
- package/dist/components/copy-button/pk-copy-button.styles.d.ts.map +1 -0
- package/dist/components/copy-button.d.ts +2 -0
- package/dist/components/copy-button.js +2 -0
- package/dist/components/date-picker/index.d.ts +3 -0
- package/dist/components/date-picker/index.d.ts.map +1 -0
- package/dist/components/date-picker/pk-date-picker.d.ts +107 -0
- package/dist/components/date-picker/pk-date-picker.d.ts.map +1 -0
- package/dist/components/date-picker/pk-date-picker.js +2 -0
- package/dist/components/date-picker/pk-date-picker.styles.d.ts +2 -0
- package/dist/components/date-picker/pk-date-picker.styles.d.ts.map +1 -0
- package/dist/components/date-picker.d.ts +2 -0
- package/dist/components/date-picker.js +2 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.d.ts.map +1 -0
- package/dist/components/dialog/pk-dialog.d.ts +87 -0
- package/dist/components/dialog/pk-dialog.d.ts.map +1 -0
- package/dist/components/dialog/pk-dialog.js +2 -0
- package/dist/components/dialog/pk-dialog.styles.d.ts +2 -0
- package/dist/components/dialog/pk-dialog.styles.d.ts.map +1 -0
- package/dist/components/dialog.d.ts +2 -0
- package/dist/components/dialog.js +2 -0
- package/dist/components/dropdown-menu/dropdown-menu-size.styles.d.ts +11 -0
- package/dist/components/dropdown-menu/dropdown-menu-size.styles.d.ts.map +1 -0
- package/dist/components/dropdown-menu/index.d.ts +5 -0
- package/dist/components/dropdown-menu/index.d.ts.map +1 -0
- package/dist/components/dropdown-menu/pk-dropdown-item.d.ts +67 -0
- package/dist/components/dropdown-menu/pk-dropdown-item.d.ts.map +1 -0
- package/dist/components/dropdown-menu/pk-dropdown-item.js +2 -0
- package/dist/components/dropdown-menu/pk-dropdown-item.styles.d.ts +2 -0
- package/dist/components/dropdown-menu/pk-dropdown-item.styles.d.ts.map +1 -0
- package/dist/components/dropdown-menu/pk-dropdown-label.d.ts +13 -0
- package/dist/components/dropdown-menu/pk-dropdown-label.d.ts.map +1 -0
- package/dist/components/dropdown-menu/pk-dropdown-label.js +2 -0
- package/dist/components/dropdown-menu/pk-dropdown-label.styles.d.ts +2 -0
- package/dist/components/dropdown-menu/pk-dropdown-label.styles.d.ts.map +1 -0
- package/dist/components/dropdown-menu/pk-dropdown-menu.d.ts +130 -0
- package/dist/components/dropdown-menu/pk-dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu/pk-dropdown-menu.js +2 -0
- package/dist/components/dropdown-menu/pk-dropdown-menu.styles.d.ts +6 -0
- package/dist/components/dropdown-menu/pk-dropdown-menu.styles.d.ts.map +1 -0
- package/dist/components/dropdown-menu/pk-dropdown-separator.d.ts +13 -0
- package/dist/components/dropdown-menu/pk-dropdown-separator.d.ts.map +1 -0
- package/dist/components/dropdown-menu/pk-dropdown-separator.js +36 -0
- package/dist/components/dropdown-menu/pk-dropdown-separator.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +2 -0
- package/dist/components/dropdown-menu.js +5 -0
- package/dist/components/editable-table/editable-table-dnd.d.ts +64 -0
- package/dist/components/editable-table/editable-table-dnd.d.ts.map +1 -0
- package/dist/components/editable-table/editable-table-model.d.ts +93 -0
- package/dist/components/editable-table/editable-table-model.d.ts.map +1 -0
- package/dist/components/editable-table/index.d.ts +3 -0
- package/dist/components/editable-table/index.d.ts.map +1 -0
- package/dist/components/editable-table/pk-editable-table.d.ts +122 -0
- package/dist/components/editable-table/pk-editable-table.d.ts.map +1 -0
- package/dist/components/editable-table/pk-editable-table.js +2 -0
- package/dist/components/editable-table/pk-editable-table.styles.d.ts +2 -0
- package/dist/components/editable-table/pk-editable-table.styles.d.ts.map +1 -0
- package/dist/components/editable-table.d.ts +2 -0
- package/dist/components/editable-table.js +2 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.d.ts.map +1 -0
- package/dist/components/field/pk-field.d.ts +69 -0
- package/dist/components/field/pk-field.d.ts.map +1 -0
- package/dist/components/field/pk-field.js +2 -0
- package/dist/components/field/pk-field.styles.d.ts +2 -0
- package/dist/components/field/pk-field.styles.d.ts.map +1 -0
- package/dist/components/field.d.ts +2 -0
- package/dist/components/field.js +2 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.d.ts.map +1 -0
- package/dist/components/icon/pk-icon-loader.d.ts +1 -0
- package/dist/components/icon/pk-icon-loader.d.ts.map +1 -0
- package/dist/components/icon/pk-icon.d.ts +46 -0
- package/dist/components/icon/pk-icon.d.ts.map +1 -0
- package/dist/components/icon/pk-icon.js +47 -0
- package/dist/components/icon/pk-icon.js.map +1 -0
- package/dist/components/icon.d.ts +2 -0
- package/dist/components/icon.js +2 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/input/pk-input.d.ts +83 -0
- package/dist/components/input/pk-input.d.ts.map +1 -0
- package/dist/components/input/pk-input.js +2 -0
- package/dist/components/input/pk-input.styles.d.ts +2 -0
- package/dist/components/input/pk-input.styles.d.ts.map +1 -0
- package/dist/components/input-group/index.d.ts +10 -0
- package/dist/components/input-group/index.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-addon.d.ts +23 -0
- package/dist/components/input-group/pk-input-group-addon.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-addon.js +2 -0
- package/dist/components/input-group/pk-input-group-addon.styles.d.ts +2 -0
- package/dist/components/input-group/pk-input-group-addon.styles.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-button.d.ts +22 -0
- package/dist/components/input-group/pk-input-group-button.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-button.js +2 -0
- package/dist/components/input-group/pk-input-group-button.styles.d.ts +2 -0
- package/dist/components/input-group/pk-input-group-button.styles.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-input.d.ts +28 -0
- package/dist/components/input-group/pk-input-group-input.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-input.js +2 -0
- package/dist/components/input-group/pk-input-group-input.styles.d.ts +2 -0
- package/dist/components/input-group/pk-input-group-input.styles.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-text.d.ts +18 -0
- package/dist/components/input-group/pk-input-group-text.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-text.js +2 -0
- package/dist/components/input-group/pk-input-group-text.styles.d.ts +2 -0
- package/dist/components/input-group/pk-input-group-text.styles.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-textarea.d.ts +25 -0
- package/dist/components/input-group/pk-input-group-textarea.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group-textarea.js +2 -0
- package/dist/components/input-group/pk-input-group-textarea.styles.d.ts +2 -0
- package/dist/components/input-group/pk-input-group-textarea.styles.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group.d.ts +39 -0
- package/dist/components/input-group/pk-input-group.d.ts.map +1 -0
- package/dist/components/input-group/pk-input-group.js +2 -0
- package/dist/components/input-group/pk-input-group.styles.d.ts +2 -0
- package/dist/components/input-group/pk-input-group.styles.d.ts.map +1 -0
- package/dist/components/input-group.d.ts +2 -0
- package/dist/components/input-group.js +7 -0
- package/dist/components/input.d.ts +2 -0
- package/dist/components/input.js +2 -0
- package/dist/components/lightswitch/index.d.ts +2 -0
- package/dist/components/lightswitch/index.d.ts.map +1 -0
- package/dist/components/lightswitch/pk-lightswitch.d.ts +54 -0
- package/dist/components/lightswitch/pk-lightswitch.d.ts.map +1 -0
- package/dist/components/lightswitch/pk-lightswitch.js +2 -0
- package/dist/components/lightswitch/pk-lightswitch.styles.d.ts +2 -0
- package/dist/components/lightswitch/pk-lightswitch.styles.d.ts.map +1 -0
- package/dist/components/lightswitch.d.ts +2 -0
- package/dist/components/lightswitch.js +2 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.d.ts.map +1 -0
- package/dist/components/popover/pk-popover.d.ts +90 -0
- package/dist/components/popover/pk-popover.d.ts.map +1 -0
- package/dist/components/popover/pk-popover.js +2 -0
- package/dist/components/popover/pk-popover.styles.d.ts +2 -0
- package/dist/components/popover/pk-popover.styles.d.ts.map +1 -0
- package/dist/components/popover.d.ts +2 -0
- package/dist/components/popover.js +2 -0
- package/dist/components/popup/index.d.ts +2 -0
- package/dist/components/popup/index.d.ts.map +1 -0
- package/dist/components/popup/pk-popup.d.ts +96 -0
- package/dist/components/popup/pk-popup.d.ts.map +1 -0
- package/dist/components/popup/pk-popup.js +2 -0
- package/dist/components/popup/pk-popup.styles.d.ts +2 -0
- package/dist/components/popup/pk-popup.styles.d.ts.map +1 -0
- package/dist/components/popup.d.ts +2 -0
- package/dist/components/popup.js +2 -0
- package/dist/components/radio-group/index.d.ts +3 -0
- package/dist/components/radio-group/index.d.ts.map +1 -0
- package/dist/components/radio-group/pk-radio-group.d.ts +58 -0
- package/dist/components/radio-group/pk-radio-group.d.ts.map +1 -0
- package/dist/components/radio-group/pk-radio-group.js +2 -0
- package/dist/components/radio-group/pk-radio-group.styles.d.ts +2 -0
- package/dist/components/radio-group/pk-radio-group.styles.d.ts.map +1 -0
- package/dist/components/radio-group/pk-radio.d.ts +37 -0
- package/dist/components/radio-group/pk-radio.d.ts.map +1 -0
- package/dist/components/radio-group/pk-radio.js +2 -0
- package/dist/components/radio-group/pk-radio.styles.d.ts +2 -0
- package/dist/components/radio-group/pk-radio.styles.d.ts.map +1 -0
- package/dist/components/radio-group.d.ts +2 -0
- package/dist/components/radio-group.js +3 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.d.ts.map +1 -0
- package/dist/components/scroll-area/pk-scroll-area.d.ts +53 -0
- package/dist/components/scroll-area/pk-scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area/pk-scroll-area.js +2 -0
- package/dist/components/scroll-area/pk-scroll-area.styles.d.ts +2 -0
- package/dist/components/scroll-area/pk-scroll-area.styles.d.ts.map +1 -0
- package/dist/components/scroll-area.d.ts +2 -0
- package/dist/components/scroll-area.js +2 -0
- package/dist/components/select/index.d.ts +4 -0
- package/dist/components/select/index.d.ts.map +1 -0
- package/dist/components/select/pk-option-group.d.ts +22 -0
- package/dist/components/select/pk-option-group.d.ts.map +1 -0
- package/dist/components/select/pk-option-group.js +2 -0
- package/dist/components/select/pk-option-group.styles.d.ts +2 -0
- package/dist/components/select/pk-option-group.styles.d.ts.map +1 -0
- package/dist/components/select/pk-option.d.ts +55 -0
- package/dist/components/select/pk-option.d.ts.map +1 -0
- package/dist/components/select/pk-option.js +2 -0
- package/dist/components/select/pk-option.styles.d.ts +2 -0
- package/dist/components/select/pk-option.styles.d.ts.map +1 -0
- package/dist/components/select/pk-select.d.ts +132 -0
- package/dist/components/select/pk-select.d.ts.map +1 -0
- package/dist/components/select/pk-select.js +2 -0
- package/dist/components/select/pk-select.styles.d.ts +2 -0
- package/dist/components/select/pk-select.styles.d.ts.map +1 -0
- package/dist/components/select.d.ts +2 -0
- package/dist/components/select.js +4 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/index.d.ts.map +1 -0
- package/dist/components/separator/pk-separator.d.ts +25 -0
- package/dist/components/separator/pk-separator.d.ts.map +1 -0
- package/dist/components/separator/pk-separator.js +2 -0
- package/dist/components/separator/pk-separator.styles.d.ts +9 -0
- package/dist/components/separator/pk-separator.styles.d.ts.map +1 -0
- package/dist/components/separator.d.ts +2 -0
- package/dist/components/separator.js +2 -0
- package/dist/components/spinner/index.d.ts +3 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/components/spinner/pk-spinner.d.ts +23 -0
- package/dist/components/spinner/pk-spinner.d.ts.map +1 -0
- package/dist/components/spinner/pk-spinner.js +2 -0
- package/dist/components/spinner/pk-spinner.styles.d.ts +2 -0
- package/dist/components/spinner/pk-spinner.styles.d.ts.map +1 -0
- package/dist/components/spinner/spinner-utils.d.ts +7 -0
- package/dist/components/spinner/spinner-utils.d.ts.map +1 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/spinner.js +3 -0
- package/dist/components/status/index.d.ts +2 -0
- package/dist/components/status/index.d.ts.map +1 -0
- package/dist/components/status/pk-status.d.ts +19 -0
- package/dist/components/status/pk-status.d.ts.map +1 -0
- package/dist/components/status/pk-status.js +2 -0
- package/dist/components/status/pk-status.styles.d.ts +2 -0
- package/dist/components/status/pk-status.styles.d.ts.map +1 -0
- package/dist/components/status.d.ts +2 -0
- package/dist/components/status.js +2 -0
- package/dist/components/tabs/index.d.ts +5 -0
- package/dist/components/tabs/index.d.ts.map +1 -0
- package/dist/components/tabs/pk-tab-base.d.ts +14 -0
- package/dist/components/tabs/pk-tab-base.d.ts.map +1 -0
- package/dist/components/tabs/pk-tab-heading.d.ts +20 -0
- package/dist/components/tabs/pk-tab-heading.d.ts.map +1 -0
- package/dist/components/tabs/pk-tab-heading.js +2 -0
- package/dist/components/tabs/pk-tab-heading.styles.d.ts +2 -0
- package/dist/components/tabs/pk-tab-heading.styles.d.ts.map +1 -0
- package/dist/components/tabs/pk-tab-panel-base.d.ts +9 -0
- package/dist/components/tabs/pk-tab-panel-base.d.ts.map +1 -0
- package/dist/components/tabs/pk-tab-panel.d.ts +18 -0
- package/dist/components/tabs/pk-tab-panel.d.ts.map +1 -0
- package/dist/components/tabs/pk-tab-panel.js +2 -0
- package/dist/components/tabs/pk-tab-panel.styles.d.ts +2 -0
- package/dist/components/tabs/pk-tab-panel.styles.d.ts.map +1 -0
- package/dist/components/tabs/pk-tab.d.ts +23 -0
- package/dist/components/tabs/pk-tab.d.ts.map +1 -0
- package/dist/components/tabs/pk-tab.js +2 -0
- package/dist/components/tabs/pk-tab.styles.d.ts +2 -0
- package/dist/components/tabs/pk-tab.styles.d.ts.map +1 -0
- package/dist/components/tabs/pk-tabs.d.ts +67 -0
- package/dist/components/tabs/pk-tabs.d.ts.map +1 -0
- package/dist/components/tabs/pk-tabs.js +2 -0
- package/dist/components/tabs/pk-tabs.styles.d.ts +6 -0
- package/dist/components/tabs/pk-tabs.styles.d.ts.map +1 -0
- package/dist/components/tabs.d.ts +2 -0
- package/dist/components/tabs.js +5 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/components/textarea/pk-textarea.d.ts +60 -0
- package/dist/components/textarea/pk-textarea.d.ts.map +1 -0
- package/dist/components/textarea/pk-textarea.js +2 -0
- package/dist/components/textarea/pk-textarea.styles.d.ts +2 -0
- package/dist/components/textarea/pk-textarea.styles.d.ts.map +1 -0
- package/dist/components/textarea.d.ts +2 -0
- package/dist/components/textarea.js +2 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/index.d.ts.map +1 -0
- package/dist/components/time-picker/pk-time-picker.d.ts +25 -0
- package/dist/components/time-picker/pk-time-picker.d.ts.map +1 -0
- package/dist/components/time-picker/pk-time-picker.js +2 -0
- package/dist/components/time-picker/pk-time-picker.styles.d.ts +2 -0
- package/dist/components/time-picker/pk-time-picker.styles.d.ts.map +1 -0
- package/dist/components/time-picker.d.ts +2 -0
- package/dist/components/time-picker.js +2 -0
- package/dist/components/tiptap/index.d.ts +4 -0
- package/dist/components/tiptap/index.d.ts.map +1 -0
- package/dist/components/tiptap/pk-tiptap-content.d.ts +25 -0
- package/dist/components/tiptap/pk-tiptap-content.d.ts.map +1 -0
- package/dist/components/tiptap/pk-tiptap-content.js +2 -0
- package/dist/components/tiptap/pk-tiptap-content.styles.d.ts +2 -0
- package/dist/components/tiptap/pk-tiptap-content.styles.d.ts.map +1 -0
- package/dist/components/tiptap/pk-tiptap-editor.d.ts +123 -0
- package/dist/components/tiptap/pk-tiptap-editor.d.ts.map +1 -0
- package/dist/components/tiptap/pk-tiptap-editor.js +2 -0
- package/dist/components/tiptap/pk-tiptap-editor.styles.d.ts +2 -0
- package/dist/components/tiptap/pk-tiptap-editor.styles.d.ts.map +1 -0
- package/dist/components/tiptap/pk-tiptap-input.d.ts +54 -0
- package/dist/components/tiptap/pk-tiptap-input.d.ts.map +1 -0
- package/dist/components/tiptap/pk-tiptap-input.js +2 -0
- package/dist/components/tiptap/pk-tiptap-input.styles.d.ts +2 -0
- package/dist/components/tiptap/pk-tiptap-input.styles.d.ts.map +1 -0
- package/dist/components/tiptap/tiptap-editor-host.d.ts +28 -0
- package/dist/components/tiptap/tiptap-editor-host.d.ts.map +1 -0
- package/dist/components/tiptap/tiptap-toolbar.d.ts +7 -0
- package/dist/components/tiptap/tiptap-toolbar.d.ts.map +1 -0
- package/dist/components/tiptap/tiptap-utils.d.ts +13 -0
- package/dist/components/tiptap/tiptap-utils.d.ts.map +1 -0
- package/dist/components/tiptap/tiptap.styles.d.ts +12 -0
- package/dist/components/tiptap/tiptap.styles.d.ts.map +1 -0
- package/dist/components/tiptap/variable-tag-node-view.d.ts +17 -0
- package/dist/components/tiptap/variable-tag-node-view.d.ts.map +1 -0
- package/dist/components/tiptap-content.d.ts +2 -0
- package/dist/components/tiptap-content.js +2 -0
- package/dist/components/tiptap-editor.d.ts +2 -0
- package/dist/components/tiptap-editor.js +2 -0
- package/dist/components/tiptap-input.d.ts +2 -0
- package/dist/components/tiptap-input.js +2 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/index.d.ts.map +1 -0
- package/dist/components/toggle/pk-toggle.d.ts +28 -0
- package/dist/components/toggle/pk-toggle.d.ts.map +1 -0
- package/dist/components/toggle/pk-toggle.js +2 -0
- package/dist/components/toggle/pk-toggle.styles.d.ts +2 -0
- package/dist/components/toggle/pk-toggle.styles.d.ts.map +1 -0
- package/dist/components/toggle-group/index.d.ts +2 -0
- package/dist/components/toggle-group/index.d.ts.map +1 -0
- package/dist/components/toggle-group/pk-toggle-group.d.ts +43 -0
- package/dist/components/toggle-group/pk-toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group/pk-toggle-group.js +2 -0
- package/dist/components/toggle-group/pk-toggle-group.styles.d.ts +2 -0
- package/dist/components/toggle-group/pk-toggle-group.styles.d.ts.map +1 -0
- package/dist/components/toggle-group.d.ts +2 -0
- package/dist/components/toggle-group.js +2 -0
- package/dist/components/toggle.d.ts +2 -0
- package/dist/components/toggle.js +2 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/components/tooltip/pk-tooltip.d.ts +73 -0
- package/dist/components/tooltip/pk-tooltip.d.ts.map +1 -0
- package/dist/components/tooltip/pk-tooltip.js +2 -0
- package/dist/components/tooltip/pk-tooltip.styles.d.ts +2 -0
- package/dist/components/tooltip/pk-tooltip.styles.d.ts.map +1 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.js +2 -0
- package/dist/create-register-components.d.ts +7 -0
- package/dist/create-register-components.d.ts.map +1 -0
- package/dist/events/overlay-lifecycle.d.ts +27 -0
- package/dist/events/overlay-lifecycle.d.ts.map +1 -0
- package/dist/events/pk-clear.d.ts +10 -0
- package/dist/events/pk-clear.d.ts.map +1 -0
- package/dist/events/pk-copy.d.ts +18 -0
- package/dist/events/pk-copy.d.ts.map +1 -0
- package/dist/events/pk-create.d.ts +11 -0
- package/dist/events/pk-create.d.ts.map +1 -0
- package/dist/events/pk-invalid.d.ts +10 -0
- package/dist/events/pk-invalid.d.ts.map +1 -0
- package/dist/events/pk-reposition.d.ts +10 -0
- package/dist/events/pk-reposition.d.ts.map +1 -0
- package/dist/icons/checkbox-indicators.d.ts +6 -0
- package/dist/icons/checkbox-indicators.d.ts.map +1 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +4 -0
- package/dist/icons/render.d.ts +7 -0
- package/dist/icons/render.d.ts.map +1 -0
- package/dist/icons/translation-icon.d.ts +2 -0
- package/dist/icons/translation-icon.d.ts.map +1 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +218 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/control-aria.d.ts +31 -0
- package/dist/internal/control-aria.d.ts.map +1 -0
- package/dist/internal/field-aria.d.ts +19 -0
- package/dist/internal/field-aria.d.ts.map +1 -0
- package/dist/internal/field-labels.d.ts +5 -0
- package/dist/internal/field-labels.d.ts.map +1 -0
- package/dist/internal/has-slot.d.ts +30 -0
- package/dist/internal/has-slot.d.ts.map +1 -0
- package/dist/internal/implicit-form-submit.d.ts +15 -0
- package/dist/internal/implicit-form-submit.d.ts.map +1 -0
- package/dist/internal/resolve-element-by-id.d.ts +3 -0
- package/dist/internal/resolve-element-by-id.d.ts.map +1 -0
- package/dist/internal/sync-listbox-separators.d.ts +3 -0
- package/dist/internal/sync-listbox-separators.d.ts.map +1 -0
- package/dist/plugin-kit.css +583 -0
- package/dist/plugin-kit.d.ts +9 -0
- package/dist/plugin-kit.d.ts.map +1 -0
- package/dist/plugin-kit.js +267 -0
- package/dist/plugin-kit.js.map +1 -0
- package/dist/plugin-kit.loader.d.ts +2 -0
- package/dist/plugin-kit.loader.d.ts.map +1 -0
- package/dist/register-components.d.ts +3 -0
- package/dist/register-components.d.ts.map +1 -0
- package/dist/register-components.js +2 -0
- package/dist/register-pk.generated.d.ts +103 -0
- package/dist/register-pk.generated.d.ts.map +1 -0
- package/dist/register.d.ts +85 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +146 -0
- package/dist/register.js.map +1 -0
- package/dist/styles/overlay-content.css +64 -0
- package/dist/styles/popup-content-animation.styles.d.ts +9 -0
- package/dist/styles/popup-content-animation.styles.d.ts.map +1 -0
- package/dist/tokens.css +408 -0
- package/dist/utilities/autoloader.d.ts +8 -0
- package/dist/utilities/autoloader.d.ts.map +1 -0
- package/dist/utilities/base-path.d.ts +3 -0
- package/dist/utilities/base-path.d.ts.map +1 -0
- package/dist/utilities/defined.d.ts +17 -0
- package/dist/utilities/defined.d.ts.map +1 -0
- package/dist/utilities/fouce-strategy.d.ts +43 -0
- package/dist/utilities/fouce-strategy.d.ts.map +1 -0
- package/dist/utilities/fouce.css +108 -0
- package/dist/utils/animate-with-class.d.ts +7 -0
- package/dist/utils/animate-with-class.d.ts.map +1 -0
- package/dist/utils/config.d.ts +15 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/copy-to-clipboard.d.ts +5 -0
- package/dist/utils/copy-to-clipboard.d.ts.map +1 -0
- package/dist/utils/craft-host-modal.d.ts +19 -0
- package/dist/utils/craft-host-modal.d.ts.map +1 -0
- package/dist/utils/date-matchers.d.ts +29 -0
- package/dist/utils/date-matchers.d.ts.map +1 -0
- package/dist/utils/date.d.ts +23 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/documentScrollStability.d.ts +11 -0
- package/dist/utils/documentScrollStability.d.ts.map +1 -0
- package/dist/utils/floating-ui.d.ts +14 -0
- package/dist/utils/floating-ui.d.ts.map +1 -0
- package/dist/utils/highlight-text.d.ts +7 -0
- package/dist/utils/highlight-text.d.ts.map +1 -0
- package/dist/utils/host-date.d.ts +8 -0
- package/dist/utils/host-date.d.ts.map +1 -0
- package/dist/utils/inline-markdown.d.ts +6 -0
- package/dist/utils/inline-markdown.d.ts.map +1 -0
- package/dist/utils/listbox-keyboard.d.ts +25 -0
- package/dist/utils/listbox-keyboard.d.ts.map +1 -0
- package/dist/utils/menu-keyboard.d.ts +15 -0
- package/dist/utils/menu-keyboard.d.ts.map +1 -0
- package/dist/utils/mount-shadow-app.d.ts +31 -0
- package/dist/utils/mount-shadow-app.d.ts.map +1 -0
- package/dist/utils/overlay-recovery.d.ts +39 -0
- package/dist/utils/overlay-recovery.d.ts.map +1 -0
- package/dist/utils/popup-placement-animation.d.ts +26 -0
- package/dist/utils/popup-placement-animation.d.ts.map +1 -0
- package/dist/utils/popup-pointer.d.ts +15 -0
- package/dist/utils/popup-pointer.d.ts.map +1 -0
- package/dist/utils/portal.d.ts +16 -0
- package/dist/utils/portal.d.ts.map +1 -0
- package/dist/utils/supports-popover.d.ts +3 -0
- package/dist/utils/supports-popover.d.ts.map +1 -0
- package/dist/utils/time-options.d.ts +16 -0
- package/dist/utils/time-options.d.ts.map +1 -0
- package/dist/utils/top-layer.d.ts +34 -0
- package/dist/utils/top-layer.d.ts.map +1 -0
- package/dist/utils/week-info.d.ts +14 -0
- package/dist/utils/week-info.d.ts.map +1 -0
- package/dist/validators/custom-error-validator.d.ts +3 -0
- package/dist/validators/custom-error-validator.d.ts.map +1 -0
- package/dist/validators/index.d.ts +6 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/mirror-validator.d.ts +4 -0
- package/dist/validators/mirror-validator.d.ts.map +1 -0
- package/dist/validators/required-validator.d.ts +7 -0
- package/dist/validators/required-validator.d.ts.map +1 -0
- package/dist/validators/types.d.ts +12 -0
- package/dist/validators/types.d.ts.map +1 -0
- package/dist-loader/chunks/animate-with-class-DT0jwaR_.js +40 -0
- package/dist-loader/chunks/button-group-item.styles-Dwakbyx5.js +145 -0
- package/dist-loader/chunks/codemirror-CSgOT0QM.js +23675 -0
- package/dist-loader/chunks/field-labels-D3lKQ2nq.js +12 -0
- package/dist-loader/chunks/floating-ui-87vslRWW.js +1220 -0
- package/dist-loader/chunks/has-slot-BGJeJdHr.js +72 -0
- package/dist-loader/chunks/icons-B1i-oRoD.js +429 -0
- package/dist-loader/chunks/lit-Dnn7gEi2.js +891 -0
- package/dist-loader/chunks/mirror-validator-C5XrXPaq.js +30 -0
- package/dist-loader/chunks/overlay-lifecycle-C3tSQ3UR.js +42 -0
- package/dist-loader/chunks/pk-a11y-Cx5RZvhu.js +274 -0
- package/dist-loader/chunks/pk-base-BlxAYXJD.js +705 -0
- package/dist-loader/chunks/pk-button-BlSs4e6V.js +846 -0
- package/dist-loader/chunks/pk-calendar-RXCDDhLI.js +1403 -0
- package/dist-loader/chunks/pk-checkbox-hJCj8In8.js +273 -0
- package/dist-loader/chunks/pk-clear-BMZUzwDt.js +13 -0
- package/dist-loader/chunks/pk-color-input-BfNtLznP.js +393 -0
- package/dist-loader/chunks/pk-combobox-1PJBcIrV.js +2006 -0
- package/dist-loader/chunks/pk-date-picker-D4vCtbw-.js +708 -0
- package/dist-loader/chunks/pk-dialog-D1RZjwQN.js +630 -0
- package/dist-loader/chunks/pk-dropdown-item-BJIhQ0Mw.js +543 -0
- package/dist-loader/chunks/pk-dropdown-menu-I1s3TBiA.js +731 -0
- package/dist-loader/chunks/pk-field-BnKPT_Kk.js +5842 -0
- package/dist-loader/chunks/pk-input-Oarjv7Vc.js +715 -0
- package/dist-loader/chunks/pk-lightswitch-D-UrNM3y.js +427 -0
- package/dist-loader/chunks/pk-option-CCZebfif.js +308 -0
- package/dist-loader/chunks/pk-popup-BNRyCsVX.js +553 -0
- package/dist-loader/chunks/pk-select-BcbtjIoP.js +1120 -0
- package/dist-loader/chunks/pk-spinner-Di9O69-m.js +145 -0
- package/dist-loader/chunks/pk-textarea-CC6WXpIu.js +334 -0
- package/dist-loader/chunks/pk-time-picker-BtGXo-KJ.js +225 -0
- package/dist-loader/chunks/pk-tooltip-JJRxVXYD.js +465 -0
- package/dist-loader/chunks/popup-content-animation.styles-S6CK-zPp.js +115 -0
- package/dist-loader/chunks/popup-placement-animation-WlEXnS85.js +58 -0
- package/dist-loader/chunks/popup-pointer-BC4n_sNb.js +19 -0
- package/dist-loader/chunks/registry-CmL0rH9r.js +55 -0
- package/dist-loader/chunks/render-DApFfV9S.js +14 -0
- package/dist-loader/chunks/required-validator-0XwZtX9k.js +27 -0
- package/dist-loader/chunks/rolldown-runtime-CzwdidQP.js +13 -0
- package/dist-loader/chunks/supports-popover-COjbi2RP.js +5 -0
- package/dist-loader/chunks/svg-Boar0Kf1.js +34 -0
- package/dist-loader/chunks/sync-listbox-separators-Bcja51HC.js +147 -0
- package/dist-loader/chunks/tiptap-Db7MTUH1.js +22888 -0
- package/dist-loader/chunks/tiptap.styles-DAH_90Fi.js +1628 -0
- package/dist-loader/components/button/button.js +2 -0
- package/dist-loader/components/button-group/button-group-separator.js +58 -0
- package/dist-loader/components/button-group/button-group-text.js +46 -0
- package/dist-loader/components/button-group/button-group.js +419 -0
- package/dist-loader/components/calendar/calendar.js +2 -0
- package/dist-loader/components/checkbox/checkbox.js +2 -0
- package/dist-loader/components/checkbox-select/checkbox-select.js +217 -0
- package/dist-loader/components/code-editor/code-editor.js +376 -0
- package/dist-loader/components/color-input/color-input.js +2 -0
- package/dist-loader/components/combobox/combobox.js +2 -0
- package/dist-loader/components/copy-button/copy-button.js +135 -0
- package/dist-loader/components/date-picker/date-picker.js +2 -0
- package/dist-loader/components/dialog/dialog.js +2 -0
- package/dist-loader/components/dropdown-menu/dropdown-item.js +2 -0
- package/dist-loader/components/dropdown-menu/dropdown-label.js +45 -0
- package/dist-loader/components/dropdown-menu/dropdown-menu.js +2 -0
- package/dist-loader/components/dropdown-menu/dropdown-separator.js +33 -0
- package/dist-loader/components/editable-table/editable-table.js +1522 -0
- package/dist-loader/components/field/field.js +2 -0
- package/dist-loader/components/icon/icon.js +17 -0
- package/dist-loader/components/input/input.js +2 -0
- package/dist-loader/components/input-group/input-group-addon.js +98 -0
- package/dist-loader/components/input-group/input-group-button.js +52 -0
- package/dist-loader/components/input-group/input-group-input.js +132 -0
- package/dist-loader/components/input-group/input-group-text.js +37 -0
- package/dist-loader/components/input-group/input-group-textarea.js +110 -0
- package/dist-loader/components/input-group/input-group.js +234 -0
- package/dist-loader/components/lightswitch/lightswitch.js +2 -0
- package/dist-loader/components/popover/popover.js +372 -0
- package/dist-loader/components/popup/popup.js +2 -0
- package/dist-loader/components/radio-group/radio-group.js +247 -0
- package/dist-loader/components/radio-group/radio.js +229 -0
- package/dist-loader/components/scroll-area/scroll-area.js +398 -0
- package/dist-loader/components/select/option-group.js +69 -0
- package/dist-loader/components/select/option.js +2 -0
- package/dist-loader/components/select/select.js +2 -0
- package/dist-loader/components/separator/separator.js +86 -0
- package/dist-loader/components/spinner/spinner.js +2 -0
- package/dist-loader/components/status/status.js +89 -0
- package/dist-loader/components/tabs/tab-heading.js +47 -0
- package/dist-loader/components/tabs/tab-panel.js +83 -0
- package/dist-loader/components/tabs/tab.js +256 -0
- package/dist-loader/components/tabs/tabs.js +619 -0
- package/dist-loader/components/textarea/textarea.js +2 -0
- package/dist-loader/components/time-picker/time-picker.js +2 -0
- package/dist-loader/components/tiptap/tiptap-content.js +72 -0
- package/dist-loader/components/tiptap/tiptap-editor.js +1078 -0
- package/dist-loader/components/tiptap/tiptap-input.js +244 -0
- package/dist-loader/components/toggle/toggle.js +253 -0
- package/dist-loader/components/toggle-group/toggle-group.js +172 -0
- package/dist-loader/components/tooltip/tooltip.js +2 -0
- package/dist-loader/plugin-kit.css +583 -0
- package/dist-loader/plugin-kit.d.ts +9 -0
- package/dist-loader/plugin-kit.d.ts.map +1 -0
- package/dist-loader/plugin-kit.loader.d.ts +2 -0
- package/dist-loader/plugin-kit.loader.d.ts.map +1 -0
- package/dist-loader/plugin-kit.loader.js +527 -0
- package/dist-loader/styles/overlay-content.css +64 -0
- package/dist-loader/tokens.css +408 -0
- package/dist-loader/utilities/autoloader.d.ts +8 -0
- package/dist-loader/utilities/autoloader.d.ts.map +1 -0
- package/dist-loader/utilities/base-path.d.ts +3 -0
- package/dist-loader/utilities/base-path.d.ts.map +1 -0
- package/dist-loader/utilities/defined.d.ts +17 -0
- package/dist-loader/utilities/defined.d.ts.map +1 -0
- package/dist-loader/utilities/fouce-strategy.d.ts +43 -0
- package/dist-loader/utilities/fouce-strategy.d.ts.map +1 -0
- package/dist-loader/utilities/fouce.css +108 -0
- package/package.json +961 -0
|
@@ -0,0 +1,1628 @@
|
|
|
1
|
+
import { n as uniqueId } from "./pk-a11y-Cx5RZvhu.js";
|
|
2
|
+
import { m as i } from "./lit-Dnn7gEi2.js";
|
|
3
|
+
import { A as Node3, C as index_default$10, D as index_default$1, E as index_default$7, F as PluginKey, I as TextSelection, N as NodeSelection, O as index_default, P as Plugin, S as index_default$11, T as index_default$8, _ as index_default$16, a as index_default$5, b as index_default$13, c as index_default$24, d as index_default$21, f as index_default$20, g as index_default$17, h as index_default$6, i as index_default$2, j as getMarkRange, l as Table, m as index_default$18, n as index_default$25, o as index_default$22, p as index_default$19, r as index_default$3, s as index_default$23, t as index_default$26, u as index_default$4, v as index_default$15, w as index_default$9, x as index_default$12, y as index_default$14 } from "./tiptap-Db7MTUH1.js";
|
|
4
|
+
//#region ../plugin-kit-tiptap-core/dist/links/extension.js
|
|
5
|
+
/** Shared Tiptap link mark configuration for Plugin Kit editors. */
|
|
6
|
+
function createLinkExtension() {
|
|
7
|
+
return index_default.configure({
|
|
8
|
+
openOnClick: false,
|
|
9
|
+
enableClickSelection: false,
|
|
10
|
+
HTMLAttributes: {
|
|
11
|
+
target: null,
|
|
12
|
+
rel: null
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region ../plugin-kit-tiptap-core/dist/extensions/variable-tag.js
|
|
18
|
+
var isCursorPlaceholder = (node) => {
|
|
19
|
+
return node && node.isText && (node.text === "" || node.text === "");
|
|
20
|
+
};
|
|
21
|
+
function createVariableTagExtension({ trailingCursorText = "", addNodeView } = {}) {
|
|
22
|
+
return Node3.create({
|
|
23
|
+
name: "variableTag",
|
|
24
|
+
group: "inline",
|
|
25
|
+
inline: true,
|
|
26
|
+
selectable: true,
|
|
27
|
+
draggable: true,
|
|
28
|
+
atom: true,
|
|
29
|
+
addOptions() {
|
|
30
|
+
return { trailingCursorText };
|
|
31
|
+
},
|
|
32
|
+
addAttributes() {
|
|
33
|
+
return {
|
|
34
|
+
label: { default: null },
|
|
35
|
+
value: { default: null },
|
|
36
|
+
openOnInsert: { default: false },
|
|
37
|
+
default: { default: null },
|
|
38
|
+
transformerId: { default: null },
|
|
39
|
+
transformerParams: { default: null },
|
|
40
|
+
unresolved: { default: false }
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
parseHTML() {
|
|
44
|
+
return [{
|
|
45
|
+
tag: "variable-tag",
|
|
46
|
+
getAttrs: (dom) => {
|
|
47
|
+
try {
|
|
48
|
+
return JSON.parse(dom.innerHTML);
|
|
49
|
+
} catch {
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}];
|
|
54
|
+
},
|
|
55
|
+
renderHTML({ HTMLAttributes }) {
|
|
56
|
+
return ["variable-tag", JSON.stringify(HTMLAttributes)];
|
|
57
|
+
},
|
|
58
|
+
addCommands() {
|
|
59
|
+
return { setVariableTag: (options) => {
|
|
60
|
+
return ({ dispatch, state }) => {
|
|
61
|
+
if (!dispatch) return false;
|
|
62
|
+
const { selection } = state;
|
|
63
|
+
const textSelection = selection;
|
|
64
|
+
const position = textSelection.$cursor ? textSelection.$cursor.pos : textSelection.$to.pos;
|
|
65
|
+
const node = this.type.create(options);
|
|
66
|
+
const transaction = state.tr.insert(position, node);
|
|
67
|
+
const insertPos = position + node.nodeSize;
|
|
68
|
+
const cursorText = this.options.trailingCursorText;
|
|
69
|
+
if (cursorText) {
|
|
70
|
+
transaction.insert(insertPos, state.schema.text(cursorText));
|
|
71
|
+
transaction.setSelection(TextSelection.create(transaction.doc, insertPos + cursorText.length));
|
|
72
|
+
} else transaction.setSelection(TextSelection.create(transaction.doc, insertPos));
|
|
73
|
+
dispatch(transaction);
|
|
74
|
+
return true;
|
|
75
|
+
};
|
|
76
|
+
} };
|
|
77
|
+
},
|
|
78
|
+
addNodeView() {
|
|
79
|
+
return addNodeView ?? null;
|
|
80
|
+
},
|
|
81
|
+
addProseMirrorPlugins() {
|
|
82
|
+
return [new Plugin({
|
|
83
|
+
key: new PluginKey("variableTagProtection"),
|
|
84
|
+
props: {
|
|
85
|
+
handleKeyDown: (view, event) => {
|
|
86
|
+
const { state } = view;
|
|
87
|
+
const { selection, doc } = state;
|
|
88
|
+
if (event.key === "ArrowLeft" && selection.empty) {
|
|
89
|
+
const { $from } = selection;
|
|
90
|
+
const { pos } = $from;
|
|
91
|
+
if (pos > 0) {
|
|
92
|
+
const before = $from.nodeBefore;
|
|
93
|
+
if (isCursorPlaceholder(before)) {
|
|
94
|
+
const posBeforePlaceholder = pos - before.nodeSize;
|
|
95
|
+
const variableTagNode = doc.resolve(posBeforePlaceholder).nodeBefore;
|
|
96
|
+
if (variableTagNode && variableTagNode.type.name === "variableTag") {
|
|
97
|
+
const tagStart = posBeforePlaceholder - variableTagNode.nodeSize;
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
view.dispatch(state.tr.setSelection(NodeSelection.create(doc, tagStart)));
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (event.key === "ArrowRight" && selection.empty) {
|
|
106
|
+
const { $from } = selection;
|
|
107
|
+
const { pos } = $from;
|
|
108
|
+
const after = $from.nodeAfter;
|
|
109
|
+
if (isCursorPlaceholder(after)) {
|
|
110
|
+
const before = $from.nodeBefore;
|
|
111
|
+
if (before && before.type.name === "variableTag") {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
view.dispatch(state.tr.setSelection(TextSelection.create(doc, pos + after.nodeSize)));
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (event.key === "Backspace" && selection.empty) {
|
|
119
|
+
const { $from } = selection;
|
|
120
|
+
const { pos } = $from;
|
|
121
|
+
if (pos > 0) {
|
|
122
|
+
const before = $from.nodeBefore;
|
|
123
|
+
if (isCursorPlaceholder(before)) {
|
|
124
|
+
const posBeforePlaceholder = pos - before.nodeSize;
|
|
125
|
+
const variableTagNode = doc.resolve(posBeforePlaceholder).nodeBefore;
|
|
126
|
+
if (variableTagNode && variableTagNode.type.name === "variableTag") {
|
|
127
|
+
const deleteFrom = posBeforePlaceholder - variableTagNode.nodeSize;
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
const tr = state.tr.delete(deleteFrom, pos);
|
|
130
|
+
tr.setSelection(TextSelection.create(tr.doc, Math.max(0, deleteFrom)));
|
|
131
|
+
view.dispatch(tr);
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (selection instanceof NodeSelection && selection.node.type.name === "variableTag") {
|
|
138
|
+
if ([
|
|
139
|
+
"ArrowLeft",
|
|
140
|
+
"ArrowRight",
|
|
141
|
+
"ArrowUp",
|
|
142
|
+
"ArrowDown",
|
|
143
|
+
"Home",
|
|
144
|
+
"End"
|
|
145
|
+
].includes(event.key)) return false;
|
|
146
|
+
if (["Delete", "Backspace"].includes(event.key)) return false;
|
|
147
|
+
if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return false;
|
|
148
|
+
if (event.key.length === 1 || event.key === "Enter") return true;
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
},
|
|
152
|
+
handlePaste: (view) => {
|
|
153
|
+
const { selection } = view.state;
|
|
154
|
+
if (selection instanceof NodeSelection && selection.node.type.name === "variableTag") return true;
|
|
155
|
+
return false;
|
|
156
|
+
},
|
|
157
|
+
handleDrop: (view) => {
|
|
158
|
+
const { selection } = view.state;
|
|
159
|
+
if (selection instanceof NodeSelection && selection.node.type.name === "variableTag" && !view.dragging) return true;
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
})];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region ../plugin-kit-tiptap-core/dist/extensions/one-liner-document.js
|
|
169
|
+
var OneLinerDocument = index_default$1.extend({ content: "inline*" });
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region ../plugin-kit-tiptap-core/dist/extensions/create-extensions.js
|
|
172
|
+
var createTiptapExtensions = ({ trailingCursorText = "", variableTagNodeView, includeVariableTag = true } = {}) => {
|
|
173
|
+
const extensions = [
|
|
174
|
+
index_default$1,
|
|
175
|
+
index_default$2,
|
|
176
|
+
index_default$3,
|
|
177
|
+
index_default$4,
|
|
178
|
+
index_default$5,
|
|
179
|
+
index_default$6,
|
|
180
|
+
index_default$7,
|
|
181
|
+
index_default$8,
|
|
182
|
+
index_default$9,
|
|
183
|
+
index_default$10,
|
|
184
|
+
index_default$11,
|
|
185
|
+
index_default$12,
|
|
186
|
+
index_default$13,
|
|
187
|
+
index_default$14,
|
|
188
|
+
index_default$15,
|
|
189
|
+
index_default$16,
|
|
190
|
+
index_default$17,
|
|
191
|
+
index_default$18.configure({ levels: [
|
|
192
|
+
1,
|
|
193
|
+
2,
|
|
194
|
+
3,
|
|
195
|
+
4,
|
|
196
|
+
5,
|
|
197
|
+
6
|
|
198
|
+
] }),
|
|
199
|
+
index_default$19,
|
|
200
|
+
index_default$20,
|
|
201
|
+
index_default$21,
|
|
202
|
+
Table.configure({ resizable: true }),
|
|
203
|
+
index_default$22,
|
|
204
|
+
index_default$23,
|
|
205
|
+
index_default$24,
|
|
206
|
+
index_default$25,
|
|
207
|
+
createLinkExtension(),
|
|
208
|
+
index_default$26.configure({
|
|
209
|
+
types: ["heading", "paragraph"],
|
|
210
|
+
defaultAlignment: "start"
|
|
211
|
+
})
|
|
212
|
+
];
|
|
213
|
+
if (includeVariableTag) extensions.push(createVariableTagExtension({
|
|
214
|
+
trailingCursorText,
|
|
215
|
+
addNodeView: variableTagNodeView
|
|
216
|
+
}));
|
|
217
|
+
return extensions;
|
|
218
|
+
};
|
|
219
|
+
var createTiptapInputExtensions = ({ trailingCursorText = "", variableTagNodeView } = {}) => {
|
|
220
|
+
return [
|
|
221
|
+
OneLinerDocument,
|
|
222
|
+
index_default$5,
|
|
223
|
+
createVariableTagExtension({
|
|
224
|
+
trailingCursorText,
|
|
225
|
+
addNodeView: variableTagNodeView
|
|
226
|
+
})
|
|
227
|
+
];
|
|
228
|
+
};
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region ../plugin-kit-tiptap-core/dist/serialization/editor.js
|
|
231
|
+
var isJsonContent = (value) => {
|
|
232
|
+
return Boolean(value) && typeof value === "object";
|
|
233
|
+
};
|
|
234
|
+
var withTrailingCursorText = (content, trailingCursorText) => {
|
|
235
|
+
if (!trailingCursorText || !content.length) return content;
|
|
236
|
+
if (content[content.length - 1].type !== "variableTag") return content;
|
|
237
|
+
return [...content, {
|
|
238
|
+
type: "text",
|
|
239
|
+
text: trailingCursorText
|
|
240
|
+
}];
|
|
241
|
+
};
|
|
242
|
+
var normalizeContentArray = (content, { trailingCursorText } = {}) => {
|
|
243
|
+
if (!Array.isArray(content)) return [];
|
|
244
|
+
return withTrailingCursorText(content.flatMap((node) => {
|
|
245
|
+
if (!node) return [];
|
|
246
|
+
if (Array.isArray(node)) return normalizeContentArray(node, { trailingCursorText });
|
|
247
|
+
if (typeof node !== "object") return [];
|
|
248
|
+
if (!("type" in node)) {
|
|
249
|
+
if (isJsonContent(node) && Array.isArray(node.content)) return normalizeContentArray(node.content, { trailingCursorText });
|
|
250
|
+
return [];
|
|
251
|
+
}
|
|
252
|
+
if (isJsonContent(node) && node.type === "text" && typeof node.text === "string") {
|
|
253
|
+
const text = node.text.replace(/[\u200B\u2060]/g, "");
|
|
254
|
+
return text ? [{
|
|
255
|
+
...node,
|
|
256
|
+
text
|
|
257
|
+
}] : [];
|
|
258
|
+
}
|
|
259
|
+
if (isJsonContent(node) && Array.isArray(node.content)) {
|
|
260
|
+
const cleaned = normalizeContentArray(node.content, { trailingCursorText });
|
|
261
|
+
return [{
|
|
262
|
+
...node,
|
|
263
|
+
content: cleaned
|
|
264
|
+
}];
|
|
265
|
+
}
|
|
266
|
+
return isJsonContent(node) ? [node] : [];
|
|
267
|
+
}), trailingCursorText);
|
|
268
|
+
};
|
|
269
|
+
var valueToContent$1 = (value, options = {}) => {
|
|
270
|
+
if (!value) return null;
|
|
271
|
+
if (Array.isArray(value)) {
|
|
272
|
+
const cleaned = normalizeContentArray(value, options);
|
|
273
|
+
return cleaned.length ? {
|
|
274
|
+
type: "doc",
|
|
275
|
+
content: cleaned
|
|
276
|
+
} : null;
|
|
277
|
+
}
|
|
278
|
+
if (isJsonContent(value)) {
|
|
279
|
+
if (value.type === "doc" && Array.isArray(value.content)) {
|
|
280
|
+
const cleaned = normalizeContentArray(value.content, options);
|
|
281
|
+
return cleaned.length ? {
|
|
282
|
+
...value,
|
|
283
|
+
content: cleaned
|
|
284
|
+
} : null;
|
|
285
|
+
}
|
|
286
|
+
if (Array.isArray(value.content)) {
|
|
287
|
+
const cleaned = normalizeContentArray(value.content, options);
|
|
288
|
+
return cleaned.length ? {
|
|
289
|
+
type: "doc",
|
|
290
|
+
content: cleaned
|
|
291
|
+
} : null;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (typeof value === "string") try {
|
|
295
|
+
const parsed = JSON.parse(value);
|
|
296
|
+
if (Array.isArray(parsed)) {
|
|
297
|
+
const cleaned = normalizeContentArray(parsed, options);
|
|
298
|
+
return cleaned.length ? {
|
|
299
|
+
type: "doc",
|
|
300
|
+
content: cleaned
|
|
301
|
+
} : null;
|
|
302
|
+
}
|
|
303
|
+
if (isJsonContent(parsed)) {
|
|
304
|
+
if (parsed.type === "doc" && Array.isArray(parsed.content)) {
|
|
305
|
+
const cleaned = normalizeContentArray(parsed.content, options);
|
|
306
|
+
return cleaned.length ? {
|
|
307
|
+
...parsed,
|
|
308
|
+
content: cleaned
|
|
309
|
+
} : null;
|
|
310
|
+
}
|
|
311
|
+
if (Array.isArray(parsed.content)) {
|
|
312
|
+
const cleaned = normalizeContentArray(parsed.content, options);
|
|
313
|
+
return cleaned.length ? {
|
|
314
|
+
type: "doc",
|
|
315
|
+
content: cleaned
|
|
316
|
+
} : null;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
} catch {
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
return null;
|
|
323
|
+
};
|
|
324
|
+
var getFatalTiptapContentError = (value) => {
|
|
325
|
+
const content = valueToContent$1(value);
|
|
326
|
+
if (!content) return "";
|
|
327
|
+
const visit = (node) => {
|
|
328
|
+
if (!node || typeof node !== "object") return false;
|
|
329
|
+
const jsonNode = node;
|
|
330
|
+
if (jsonNode.type === "text" && typeof jsonNode.text === "string" && jsonNode.text === "") return true;
|
|
331
|
+
if (!Array.isArray(jsonNode.content)) return false;
|
|
332
|
+
return jsonNode.content.some((child) => {
|
|
333
|
+
return visit(child);
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
return visit(content) ? "This field contains invalid rich-text content. The editor could not fully parse the stored document, so some content may not be shown until it is repaired and saved again." : "";
|
|
337
|
+
};
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region ../plugin-kit-tiptap-core/dist/serialization/input.js
|
|
340
|
+
var TRANSFORMER_ID_PREFIX = "transform=";
|
|
341
|
+
function parseTokenMetadata(tokenValue) {
|
|
342
|
+
const match = tokenValue.match(/^\{([^}]*)\}$/);
|
|
343
|
+
if (!match) return { tokenWithoutDefault: tokenValue };
|
|
344
|
+
let body = match[1] ?? "";
|
|
345
|
+
let defaultIfEmpty;
|
|
346
|
+
if (body.includes("|")) {
|
|
347
|
+
const split = body.split("|");
|
|
348
|
+
body = split.shift() ?? "";
|
|
349
|
+
defaultIfEmpty = split.join("|").trim() || void 0;
|
|
350
|
+
}
|
|
351
|
+
const segments = body.split(";").map((part) => {
|
|
352
|
+
return part.trim();
|
|
353
|
+
}).filter(Boolean);
|
|
354
|
+
const cleanSegments = [];
|
|
355
|
+
let transformerId;
|
|
356
|
+
let transformerParams;
|
|
357
|
+
const referenceParams = {};
|
|
358
|
+
let isTransformerParam = false;
|
|
359
|
+
segments.forEach((segment) => {
|
|
360
|
+
if (segment.startsWith(TRANSFORMER_ID_PREFIX)) {
|
|
361
|
+
transformerId = decodeURIComponent(segment.slice(10)).trim() || void 0;
|
|
362
|
+
isTransformerParam = true;
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (segment.includes("=")) {
|
|
366
|
+
const [keyRaw, ...valueParts] = segment.split("=");
|
|
367
|
+
const key = (keyRaw ?? "").trim().toLowerCase();
|
|
368
|
+
if (!key) return;
|
|
369
|
+
const value = decodeURIComponent(valueParts.join("=").trim());
|
|
370
|
+
if (isTransformerParam) {
|
|
371
|
+
if (!transformerParams) transformerParams = {};
|
|
372
|
+
transformerParams[key] = value;
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
referenceParams[key] = value;
|
|
376
|
+
cleanSegments.push(`${key}=${encodeURIComponent(value)}`);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
cleanSegments.push(segment);
|
|
380
|
+
});
|
|
381
|
+
return {
|
|
382
|
+
tokenWithoutDefault: `{${cleanSegments.join(";")}}`,
|
|
383
|
+
defaultIfEmpty,
|
|
384
|
+
transformerId,
|
|
385
|
+
transformerParams,
|
|
386
|
+
referenceParams
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function isVariableLikeToken(tokenValue) {
|
|
390
|
+
return /^\{[a-zA-Z][a-zA-Z0-9_]*(?::[^}]*)?\}$/.test(tokenValue);
|
|
391
|
+
}
|
|
392
|
+
/** Craft field UIDs — never surface these as chip labels. */
|
|
393
|
+
var FIELD_UID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
394
|
+
function isLikelyFieldUid(value) {
|
|
395
|
+
return FIELD_UID_PATTERN.test(String(value || "").trim());
|
|
396
|
+
}
|
|
397
|
+
function toTitleWords(value) {
|
|
398
|
+
return value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().replace(/\s+/g, " ").replace(/\b\w/g, (char) => {
|
|
399
|
+
return char.toUpperCase();
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Label when no variable option matched. Prefer a clear "unknown" prompt over
|
|
404
|
+
* title-casing UIDs (e.g. "7aff44ed Bca7…"), which looks broken rather than fixable.
|
|
405
|
+
*/
|
|
406
|
+
function buildFallbackLabelForUnknownToken(tokenWithoutDefault) {
|
|
407
|
+
if (tokenWithoutDefault.match(/^\{field:([^}]+)\}$/)) return "Unknown field";
|
|
408
|
+
const [target = "", identifier = "", selector = ""] = tokenWithoutDefault.replace(/^\{|\}$/g, "").split(":");
|
|
409
|
+
const reference = String(selector || identifier || target).split(";")[0]?.trim() ?? "";
|
|
410
|
+
if (isLikelyFieldUid(reference) || isLikelyFieldUid(identifier)) return "Unknown variable";
|
|
411
|
+
if (target) return toTitleWords(reference) || "Unknown variable";
|
|
412
|
+
return "Unknown variable";
|
|
413
|
+
}
|
|
414
|
+
function serializeTokenMetadata(baseToken, metadata) {
|
|
415
|
+
const baseMatch = baseToken.match(/^\{([^}]*)\}$/);
|
|
416
|
+
if (!baseMatch) return baseToken;
|
|
417
|
+
const parts = [baseMatch[1]];
|
|
418
|
+
const transformerId = metadata.transformerId?.trim();
|
|
419
|
+
const params = metadata.transformerParams && typeof metadata.transformerParams === "object" ? Object.entries(metadata.transformerParams) : [];
|
|
420
|
+
if (transformerId) {
|
|
421
|
+
parts.push(`${TRANSFORMER_ID_PREFIX}${encodeURIComponent(transformerId)}`);
|
|
422
|
+
params.forEach(([key, value]) => {
|
|
423
|
+
const normalizedKey = String(key ?? "").trim();
|
|
424
|
+
if (!normalizedKey || normalizedKey === "transform") return;
|
|
425
|
+
const normalizedValue = value == null ? "" : String(value);
|
|
426
|
+
parts.push(`${normalizedKey}=${encodeURIComponent(normalizedValue)}`);
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
const tokenBody = parts.filter(Boolean).join(";");
|
|
430
|
+
const defaultIfEmpty = metadata.defaultIfEmpty?.trim();
|
|
431
|
+
return defaultIfEmpty ? `{${tokenBody}|${defaultIfEmpty}}` : `{${tokenBody}}`;
|
|
432
|
+
}
|
|
433
|
+
function dedupeVariableOptions(items) {
|
|
434
|
+
const deduped = [];
|
|
435
|
+
const seen = /* @__PURE__ */ new Set();
|
|
436
|
+
items.forEach((item) => {
|
|
437
|
+
const key = String(item?.value ?? "") || `__label:${String(item?.label ?? "")}`;
|
|
438
|
+
if (seen.has(key)) return;
|
|
439
|
+
seen.add(key);
|
|
440
|
+
deduped.push(item);
|
|
441
|
+
});
|
|
442
|
+
return deduped;
|
|
443
|
+
}
|
|
444
|
+
function flattenVariableOptions(items) {
|
|
445
|
+
const flat = [];
|
|
446
|
+
const visit = (nodes) => {
|
|
447
|
+
nodes.forEach((node) => {
|
|
448
|
+
flat.push(node);
|
|
449
|
+
if (Array.isArray(node.children) && node.children.length > 0) visit(node.children);
|
|
450
|
+
});
|
|
451
|
+
};
|
|
452
|
+
visit(items);
|
|
453
|
+
return flat;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Build VariableTag attributes from base and selected variable options.
|
|
457
|
+
* Optional defaultIfEmpty is used when the resolved value is empty (e.g. "Guest" for {user:firstName|Guest}).
|
|
458
|
+
*/
|
|
459
|
+
function buildVariableTagAttrs(baseVariable, selectedVariable = baseVariable, options = {}) {
|
|
460
|
+
const selectedLabel = options.label ?? selectedVariable?.label ?? baseVariable?.label ?? "";
|
|
461
|
+
const value = options.value ?? selectedVariable?.value ?? baseVariable?.value ?? "";
|
|
462
|
+
const defaultIfEmpty = options.defaultIfEmpty?.trim();
|
|
463
|
+
const attrs = {
|
|
464
|
+
label: selectedLabel,
|
|
465
|
+
value,
|
|
466
|
+
openOnInsert: options.openOnInsert ?? false
|
|
467
|
+
};
|
|
468
|
+
if (defaultIfEmpty) attrs.default = defaultIfEmpty;
|
|
469
|
+
if (options.transformerId?.trim()) attrs.transformerId = options.transformerId.trim();
|
|
470
|
+
if (options.transformerParams && typeof options.transformerParams === "object") attrs.transformerParams = options.transformerParams;
|
|
471
|
+
return attrs;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Strip optional inline default from token for lookup: {user:firstName|Guest} -> {user:firstName}.
|
|
475
|
+
* Returns [tokenWithoutDefault, defaultText].
|
|
476
|
+
*/
|
|
477
|
+
function parseTokenWithDefault(tokenValue) {
|
|
478
|
+
const parsed = parseTokenMetadata(tokenValue);
|
|
479
|
+
return [parsed.tokenWithoutDefault, parsed.defaultIfEmpty];
|
|
480
|
+
}
|
|
481
|
+
function getReferenceBaseToken(tokenValue) {
|
|
482
|
+
const [tokenWithoutDefault] = parseTokenWithDefault(tokenValue);
|
|
483
|
+
const match = tokenWithoutDefault.match(/^\{([^}]*)\}$/);
|
|
484
|
+
if (!match) return tokenWithoutDefault;
|
|
485
|
+
const body = match[1].split(";")[0]?.trim() ?? "";
|
|
486
|
+
return body ? `{${body}}` : tokenWithoutDefault;
|
|
487
|
+
}
|
|
488
|
+
function variableValuesMatchReference(tokenValue, optionValue) {
|
|
489
|
+
if (!tokenValue || !optionValue) return false;
|
|
490
|
+
if (tokenValue === optionValue) return true;
|
|
491
|
+
return getReferenceBaseToken(tokenValue) === getReferenceBaseToken(optionValue);
|
|
492
|
+
}
|
|
493
|
+
function resolveVariableTagLabel(tokenValue, option) {
|
|
494
|
+
const { tokenWithoutDefault } = parseTokenMetadata(String(tokenValue || ""));
|
|
495
|
+
if (option?.label) return option.label;
|
|
496
|
+
return buildFallbackLabelForUnknownToken(tokenWithoutDefault);
|
|
497
|
+
}
|
|
498
|
+
function findMatchingVariableOption(items, tokenWithoutDefault) {
|
|
499
|
+
let fallbackMatch = null;
|
|
500
|
+
for (const item of items) {
|
|
501
|
+
const children = Array.isArray(item.children) ? item.children : [];
|
|
502
|
+
const itemValue = String(item.value ?? "");
|
|
503
|
+
if (itemValue === tokenWithoutDefault) return item;
|
|
504
|
+
if (children.length) {
|
|
505
|
+
const childMatch = findMatchingVariableOption(children, tokenWithoutDefault);
|
|
506
|
+
if (childMatch?.value === tokenWithoutDefault) return childMatch;
|
|
507
|
+
if (childMatch && !fallbackMatch) fallbackMatch = childMatch;
|
|
508
|
+
}
|
|
509
|
+
if (variableValuesMatchReference(tokenWithoutDefault, itemValue)) {
|
|
510
|
+
if (!fallbackMatch) fallbackMatch = item;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
return fallbackMatch;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Resolve variable tag attrs from a token string (e.g. '{form:name}' or '{user:firstName|Guest}').
|
|
517
|
+
*/
|
|
518
|
+
function resolveVariableTagByValue(tokenValue, topLevelVariables, allVariables) {
|
|
519
|
+
const { tokenWithoutDefault, defaultIfEmpty, transformerId, transformerParams } = parseTokenMetadata(tokenValue);
|
|
520
|
+
const resolvedValue = tokenWithoutDefault;
|
|
521
|
+
const topLevelMatch = findMatchingVariableOption(topLevelVariables, tokenWithoutDefault);
|
|
522
|
+
if (topLevelMatch) return buildVariableTagAttrs(topLevelMatch, topLevelMatch, {
|
|
523
|
+
defaultIfEmpty,
|
|
524
|
+
transformerId,
|
|
525
|
+
transformerParams,
|
|
526
|
+
label: resolveVariableTagLabel(resolvedValue, topLevelMatch),
|
|
527
|
+
value: resolvedValue
|
|
528
|
+
});
|
|
529
|
+
const fallback = findMatchingVariableOption(allVariables, tokenWithoutDefault);
|
|
530
|
+
if (fallback) return buildVariableTagAttrs(fallback, fallback, {
|
|
531
|
+
defaultIfEmpty,
|
|
532
|
+
transformerId,
|
|
533
|
+
transformerParams,
|
|
534
|
+
label: resolveVariableTagLabel(resolvedValue, fallback),
|
|
535
|
+
value: resolvedValue
|
|
536
|
+
});
|
|
537
|
+
if (isVariableLikeToken(tokenWithoutDefault)) return {
|
|
538
|
+
label: resolveVariableTagLabel(tokenWithoutDefault, null),
|
|
539
|
+
value: tokenWithoutDefault,
|
|
540
|
+
openOnInsert: false,
|
|
541
|
+
unresolved: true,
|
|
542
|
+
...defaultIfEmpty ? { default: defaultIfEmpty } : {},
|
|
543
|
+
...transformerId ? { transformerId } : {},
|
|
544
|
+
...transformerParams ? { transformerParams } : {}
|
|
545
|
+
};
|
|
546
|
+
return null;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Convert string value with {token} placeholders to Tiptap doc content.
|
|
550
|
+
*/
|
|
551
|
+
function valueToContent(value, topLevelVariables, allVariables, trailingCursorText = "") {
|
|
552
|
+
if (!value) return null;
|
|
553
|
+
const content = value.split(/({.*?})/).flatMap((param) => {
|
|
554
|
+
if (param.includes("{")) {
|
|
555
|
+
const variable = resolveVariableTagByValue(param, topLevelVariables, allVariables);
|
|
556
|
+
if (variable) return [{
|
|
557
|
+
type: "variableTag",
|
|
558
|
+
attrs: variable
|
|
559
|
+
}];
|
|
560
|
+
}
|
|
561
|
+
if (!param) return [];
|
|
562
|
+
return [{
|
|
563
|
+
type: "text",
|
|
564
|
+
text: param
|
|
565
|
+
}];
|
|
566
|
+
});
|
|
567
|
+
if (trailingCursorText && content.length && content[content.length - 1].type === "variableTag") content.push({
|
|
568
|
+
type: "text",
|
|
569
|
+
text: trailingCursorText
|
|
570
|
+
});
|
|
571
|
+
return {
|
|
572
|
+
type: "doc",
|
|
573
|
+
content
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Convert Tiptap content to string value.
|
|
578
|
+
* Content is typically editor.getJSON().content (array of block/inline nodes).
|
|
579
|
+
*/
|
|
580
|
+
function contentToValue(content) {
|
|
581
|
+
if (!content) return "";
|
|
582
|
+
const items = Array.isArray(content) ? content : [];
|
|
583
|
+
let result = "";
|
|
584
|
+
const visit = (nodes) => {
|
|
585
|
+
nodes.forEach((node) => {
|
|
586
|
+
if (!node || typeof node !== "object") return;
|
|
587
|
+
const n = node;
|
|
588
|
+
if (n.type === "paragraph" && Array.isArray(n.content)) visit(n.content);
|
|
589
|
+
else if (n.type === "text") result += (n.text ?? "").replace(/[\u200B\u2060]/g, "");
|
|
590
|
+
else if (n.type === "variableTag") {
|
|
591
|
+
const val = n.attrs?.value ?? "";
|
|
592
|
+
const def = n.attrs?.default?.trim();
|
|
593
|
+
const transformerId = n.attrs?.transformerId?.trim();
|
|
594
|
+
const transformerParams = n.attrs?.transformerParams;
|
|
595
|
+
result += serializeTokenMetadata(val, {
|
|
596
|
+
defaultIfEmpty: def,
|
|
597
|
+
transformerId,
|
|
598
|
+
transformerParams
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
};
|
|
603
|
+
visit(items);
|
|
604
|
+
return result.replace(/[\r\n]+/g, " ");
|
|
605
|
+
}
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region ../plugin-kit-tiptap-core/dist/links/craft-element.js
|
|
608
|
+
function isLinkOptionsArray(value) {
|
|
609
|
+
return Array.isArray(value) && value.length > 0;
|
|
610
|
+
}
|
|
611
|
+
function getCraftLinkOptions(linkOptions) {
|
|
612
|
+
if (!linkOptions) return [];
|
|
613
|
+
if (isLinkOptionsArray(linkOptions)) return linkOptions;
|
|
614
|
+
const items = [];
|
|
615
|
+
if (linkOptions.linkToEntry) items.push({
|
|
616
|
+
...linkOptions.linkToEntry,
|
|
617
|
+
optionTitle: "Link to an entry"
|
|
618
|
+
});
|
|
619
|
+
if (linkOptions.linkToAsset) items.push({
|
|
620
|
+
...linkOptions.linkToAsset,
|
|
621
|
+
optionTitle: "Link to an asset"
|
|
622
|
+
});
|
|
623
|
+
if (linkOptions.linkToCategory) items.push({
|
|
624
|
+
...linkOptions.linkToCategory,
|
|
625
|
+
optionTitle: "Link to a category"
|
|
626
|
+
});
|
|
627
|
+
return items;
|
|
628
|
+
}
|
|
629
|
+
function getLinkOptionsElementSiteId(linkOptions) {
|
|
630
|
+
if (!linkOptions || isLinkOptionsArray(linkOptions)) return;
|
|
631
|
+
return linkOptions.elementSiteId;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Build a Craft element link URL with the standard ref fragment:
|
|
635
|
+
* `https://example.com/page#refHandle:123@1`
|
|
636
|
+
*/
|
|
637
|
+
function buildCraftElementLinkUrl(element, refHandle) {
|
|
638
|
+
return `${element.url || ""}#${refHandle}:${element.id}@${element.siteId}`;
|
|
639
|
+
}
|
|
640
|
+
function buildCraftElementSelectorStorageKey(linkSelectorStorageKeyPrefix, elementType) {
|
|
641
|
+
return `${linkSelectorStorageKeyPrefix}.${elementType}`;
|
|
642
|
+
}
|
|
643
|
+
/** Open Craft's element selector modal and return a Plugin Kit link URL on selection. */
|
|
644
|
+
function openCraftElementLinkSelector({ config, elementSiteId, linkSelectorStorageKeyPrefix, getSelectedText, onSelect, host }) {
|
|
645
|
+
if (!linkSelectorStorageKeyPrefix) throw new Error("Craft element links require \"linkSelectorStorageKeyPrefix\".");
|
|
646
|
+
host.openElementSelector(config.elementType, {
|
|
647
|
+
storageKey: buildCraftElementSelectorStorageKey(linkSelectorStorageKeyPrefix, config.elementType),
|
|
648
|
+
sources: config.sources,
|
|
649
|
+
criteria: config.criteria,
|
|
650
|
+
defaultSiteId: elementSiteId,
|
|
651
|
+
autoFocusSearchBox: false,
|
|
652
|
+
onSelect: (elements) => {
|
|
653
|
+
if (!elements?.length) return;
|
|
654
|
+
const [element] = elements;
|
|
655
|
+
onSelect({
|
|
656
|
+
url: buildCraftElementLinkUrl(element, config.refHandle),
|
|
657
|
+
text: getSelectedText() || element.label || ""
|
|
658
|
+
});
|
|
659
|
+
},
|
|
660
|
+
closeOtherModals: false
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region ../plugin-kit-tiptap-core/dist/links/commands.js
|
|
665
|
+
function buildLinkMarkAttributes(url, openInNewTab) {
|
|
666
|
+
const linkAttrs = { href: url };
|
|
667
|
+
if (openInNewTab) linkAttrs.target = "_blank";
|
|
668
|
+
return linkAttrs;
|
|
669
|
+
}
|
|
670
|
+
function getSelectedText(editor) {
|
|
671
|
+
const { from, to } = editor.state.selection;
|
|
672
|
+
return editor.state.doc.textBetween(from, to, " ");
|
|
673
|
+
}
|
|
674
|
+
function getLinkOpenInNewTab(editor) {
|
|
675
|
+
return editor.isActive("link") && editor.getAttributes("link").target === "_blank";
|
|
676
|
+
}
|
|
677
|
+
function getLinkEditState(editor) {
|
|
678
|
+
const { href } = editor.getAttributes("link");
|
|
679
|
+
const { state } = editor;
|
|
680
|
+
const linkType = state.schema.marks.link;
|
|
681
|
+
const range = getMarkRange(state.selection.$from, linkType);
|
|
682
|
+
const from = range?.from ?? state.selection.from;
|
|
683
|
+
const to = range?.to ?? state.selection.to;
|
|
684
|
+
const text = editor.state.doc.textBetween(from, to, " ");
|
|
685
|
+
return {
|
|
686
|
+
from,
|
|
687
|
+
to,
|
|
688
|
+
href: href ?? "",
|
|
689
|
+
text,
|
|
690
|
+
openInNewTab: getLinkOpenInNewTab(editor)
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
function applyLinkToEditor(editor, params) {
|
|
694
|
+
const { url, text, openInNewTab, from: fromParam, to: toParam } = params;
|
|
695
|
+
const chain = editor.chain().focus();
|
|
696
|
+
const linkAttrs = buildLinkMarkAttributes(url, openInNewTab);
|
|
697
|
+
const content = {
|
|
698
|
+
type: "text",
|
|
699
|
+
text: text.trim() || url,
|
|
700
|
+
marks: [{
|
|
701
|
+
type: "link",
|
|
702
|
+
attrs: linkAttrs
|
|
703
|
+
}]
|
|
704
|
+
};
|
|
705
|
+
if (typeof fromParam === "number" && typeof toParam === "number" && fromParam !== toParam) {
|
|
706
|
+
chain.insertContentAt({
|
|
707
|
+
from: fromParam,
|
|
708
|
+
to: toParam
|
|
709
|
+
}, [content]).run();
|
|
710
|
+
return;
|
|
711
|
+
}
|
|
712
|
+
const { from, to } = editor.state.selection;
|
|
713
|
+
if (editor.state.doc.textBetween(from, to, " ")) {
|
|
714
|
+
chain.extendMarkRange("link").setLink(linkAttrs).run();
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
chain.insertContent([content]).run();
|
|
718
|
+
}
|
|
719
|
+
function unsetLinkFromEditor(editor) {
|
|
720
|
+
editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
721
|
+
}
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region ../plugin-kit-tiptap-core/dist/toolbar/button-registry.js
|
|
724
|
+
var HEADING_LEVELS = [
|
|
725
|
+
1,
|
|
726
|
+
2,
|
|
727
|
+
3,
|
|
728
|
+
4,
|
|
729
|
+
5,
|
|
730
|
+
6
|
|
731
|
+
];
|
|
732
|
+
function isTiptapButtonName(value) {
|
|
733
|
+
if (HEADING_LEVELS.some((level) => value === `h${level}`)) return true;
|
|
734
|
+
return [
|
|
735
|
+
"bold",
|
|
736
|
+
"italic",
|
|
737
|
+
"underline",
|
|
738
|
+
"strikethrough",
|
|
739
|
+
"subscript",
|
|
740
|
+
"superscript",
|
|
741
|
+
"unordered-list",
|
|
742
|
+
"ordered-list",
|
|
743
|
+
"blockquote",
|
|
744
|
+
"highlight",
|
|
745
|
+
"code",
|
|
746
|
+
"code-block",
|
|
747
|
+
"hr",
|
|
748
|
+
"line-break",
|
|
749
|
+
"align-left",
|
|
750
|
+
"align-center",
|
|
751
|
+
"align-right",
|
|
752
|
+
"align-justify",
|
|
753
|
+
"clear-format",
|
|
754
|
+
"undo",
|
|
755
|
+
"redo",
|
|
756
|
+
"link",
|
|
757
|
+
"table",
|
|
758
|
+
"variableTag"
|
|
759
|
+
].includes(value);
|
|
760
|
+
}
|
|
761
|
+
function isTiptapButtonActive(editor, buttonName) {
|
|
762
|
+
if (!isTiptapButtonName(buttonName)) return false;
|
|
763
|
+
const headingMatch = buttonName.match(/^h([1-6])$/);
|
|
764
|
+
if (headingMatch) {
|
|
765
|
+
const level = Number(headingMatch[1]);
|
|
766
|
+
return editor.isActive("heading", { level });
|
|
767
|
+
}
|
|
768
|
+
switch (buttonName) {
|
|
769
|
+
case "bold": return editor.isActive("bold");
|
|
770
|
+
case "italic": return editor.isActive("italic");
|
|
771
|
+
case "underline": return editor.isActive("underline");
|
|
772
|
+
case "strikethrough": return editor.isActive("strike");
|
|
773
|
+
case "subscript": return editor.isActive("subscript");
|
|
774
|
+
case "superscript": return editor.isActive("superscript");
|
|
775
|
+
case "unordered-list": return editor.isActive("bulletList");
|
|
776
|
+
case "ordered-list": return editor.isActive("orderedList");
|
|
777
|
+
case "blockquote": return editor.isActive("blockquote");
|
|
778
|
+
case "highlight": return editor.isActive("highlight");
|
|
779
|
+
case "code": return editor.isActive("code");
|
|
780
|
+
case "code-block": return editor.isActive("codeBlock");
|
|
781
|
+
case "align-left": return editor.isActive({ textAlign: "left" });
|
|
782
|
+
case "align-center": return editor.isActive({ textAlign: "center" });
|
|
783
|
+
case "align-right": return editor.isActive({ textAlign: "right" });
|
|
784
|
+
case "align-justify": return editor.isActive({ textAlign: "justify" });
|
|
785
|
+
case "link": return editor.isActive("link");
|
|
786
|
+
case "variableTag": return editor.isActive("variableTag");
|
|
787
|
+
default: return false;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
function runTiptapButton(editor, buttonName, options = {}) {
|
|
791
|
+
if (!isTiptapButtonName(buttonName)) return false;
|
|
792
|
+
const chain = editor.chain().focus();
|
|
793
|
+
const headingMatch = buttonName.match(/^h([1-6])$/);
|
|
794
|
+
if (headingMatch) {
|
|
795
|
+
const level = Number(headingMatch[1]);
|
|
796
|
+
return chain.toggleHeading({ level }).run();
|
|
797
|
+
}
|
|
798
|
+
switch (buttonName) {
|
|
799
|
+
case "bold": return chain.toggleBold().run();
|
|
800
|
+
case "italic": return chain.toggleItalic().run();
|
|
801
|
+
case "underline": return chain.toggleUnderline().run();
|
|
802
|
+
case "strikethrough": return chain.toggleStrike().run();
|
|
803
|
+
case "subscript": return chain.toggleSubscript().run();
|
|
804
|
+
case "superscript": return chain.toggleSuperscript().run();
|
|
805
|
+
case "unordered-list": return chain.toggleBulletList().run();
|
|
806
|
+
case "ordered-list": return chain.toggleOrderedList().run();
|
|
807
|
+
case "blockquote": return chain.toggleBlockquote().run();
|
|
808
|
+
case "highlight": return chain.toggleHighlight().run();
|
|
809
|
+
case "code": return chain.toggleCode().run();
|
|
810
|
+
case "code-block": return chain.toggleCodeBlock().run();
|
|
811
|
+
case "hr": return chain.setHorizontalRule().run();
|
|
812
|
+
case "line-break": return chain.setHardBreak().run();
|
|
813
|
+
case "align-left": return chain.setTextAlign("left").run();
|
|
814
|
+
case "align-center": return chain.setTextAlign("center").run();
|
|
815
|
+
case "align-right": return chain.setTextAlign("right").run();
|
|
816
|
+
case "align-justify": return chain.setTextAlign("justify").run();
|
|
817
|
+
case "clear-format": return chain.clearNodes().unsetAllMarks().run();
|
|
818
|
+
case "undo": return chain.undo().run();
|
|
819
|
+
case "redo": return chain.redo().run();
|
|
820
|
+
case "table": {
|
|
821
|
+
const tableOptions = options.tableOptions ?? {};
|
|
822
|
+
return chain.insertTable({
|
|
823
|
+
rows: tableOptions.rows ?? 3,
|
|
824
|
+
cols: tableOptions.cols ?? 3,
|
|
825
|
+
withHeaderRow: tableOptions.withHeaderRow ?? true
|
|
826
|
+
}).run();
|
|
827
|
+
}
|
|
828
|
+
case "link":
|
|
829
|
+
case "variableTag": return false;
|
|
830
|
+
default: return false;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
//#endregion
|
|
834
|
+
//#region ../plugin-kit-tiptap-core/dist/toolbar/toolbar-schema.js
|
|
835
|
+
var DEFAULT_HEADING_LEVELS = [
|
|
836
|
+
1,
|
|
837
|
+
2,
|
|
838
|
+
3,
|
|
839
|
+
4
|
|
840
|
+
];
|
|
841
|
+
var PRESET_DEFAULT_ICONS = {
|
|
842
|
+
formatting: "paragraph",
|
|
843
|
+
headings: "heading",
|
|
844
|
+
lists: "unordered-list",
|
|
845
|
+
align: "align-left"
|
|
846
|
+
};
|
|
847
|
+
var VALID_PRESETS = new Set([
|
|
848
|
+
"formatting",
|
|
849
|
+
"headings",
|
|
850
|
+
"lists",
|
|
851
|
+
"align"
|
|
852
|
+
]);
|
|
853
|
+
function isFormattingToolbarPreset(preset) {
|
|
854
|
+
return preset === "formatting";
|
|
855
|
+
}
|
|
856
|
+
function isHeadingsOnlyToolbarPreset(preset) {
|
|
857
|
+
return preset === "headings";
|
|
858
|
+
}
|
|
859
|
+
function getToolbarGroupDefaultIcon(group) {
|
|
860
|
+
if (group.preset) return PRESET_DEFAULT_ICONS[group.preset];
|
|
861
|
+
return getToolbarGroupItems(group)[0] ?? "bold";
|
|
862
|
+
}
|
|
863
|
+
var SEPARATOR_TOKENS = new Set(["|", "separator"]);
|
|
864
|
+
function isToolbarSeparatorToken(value) {
|
|
865
|
+
return SEPARATOR_TOKENS.has(value);
|
|
866
|
+
}
|
|
867
|
+
function expandPresetItems(group) {
|
|
868
|
+
if (group.items?.length) return group.items.filter((item) => typeof item === "string" && isTiptapButtonName(item));
|
|
869
|
+
switch (group.preset) {
|
|
870
|
+
case "formatting": return [
|
|
871
|
+
...(group.headingLevels ?? DEFAULT_HEADING_LEVELS).map((level) => `h${level}`),
|
|
872
|
+
"blockquote",
|
|
873
|
+
"code-block"
|
|
874
|
+
];
|
|
875
|
+
case "headings": return (group.headingLevels ?? DEFAULT_HEADING_LEVELS).map((level) => `h${level}`);
|
|
876
|
+
case "lists": return ["unordered-list", "ordered-list"];
|
|
877
|
+
case "align": return [
|
|
878
|
+
"align-left",
|
|
879
|
+
"align-center",
|
|
880
|
+
"align-right",
|
|
881
|
+
"align-justify"
|
|
882
|
+
];
|
|
883
|
+
default: return [];
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
function getToolbarGroupItems(group) {
|
|
887
|
+
return expandPresetItems(group);
|
|
888
|
+
}
|
|
889
|
+
function flattenToolbarButtonNames(nodes) {
|
|
890
|
+
const names = [];
|
|
891
|
+
nodes.forEach((node) => {
|
|
892
|
+
if (node.type === "button") {
|
|
893
|
+
names.push(node.name);
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
if (node.type === "group") names.push(...getToolbarGroupItems(node.group));
|
|
897
|
+
});
|
|
898
|
+
return names;
|
|
899
|
+
}
|
|
900
|
+
function toolbarIncludesButton(nodes, buttonName) {
|
|
901
|
+
return flattenToolbarButtonNames(nodes).includes(buttonName);
|
|
902
|
+
}
|
|
903
|
+
function normalizeGroupItemDefinition(raw) {
|
|
904
|
+
if (typeof raw === "string") {
|
|
905
|
+
const token = raw.trim();
|
|
906
|
+
if (!token) return null;
|
|
907
|
+
if (isToolbarSeparatorToken(token)) return token;
|
|
908
|
+
if (token === "paragraph") return "paragraph";
|
|
909
|
+
return normalizeButtonName(token);
|
|
910
|
+
}
|
|
911
|
+
if (!raw || typeof raw !== "object") return null;
|
|
912
|
+
const record = raw;
|
|
913
|
+
if (record.type === "separator") return { type: "separator" };
|
|
914
|
+
if (record.type === "item" && typeof record.name === "string") {
|
|
915
|
+
if (record.name === "paragraph") return "paragraph";
|
|
916
|
+
return normalizeButtonName(record.name);
|
|
917
|
+
}
|
|
918
|
+
return null;
|
|
919
|
+
}
|
|
920
|
+
function normalizeGroupItemDefinitions(raw) {
|
|
921
|
+
return raw.map((item) => normalizeGroupItemDefinition(item)).filter((item) => item !== null);
|
|
922
|
+
}
|
|
923
|
+
function isGroupItemSeparator(item) {
|
|
924
|
+
return item === "|" || item === "separator" || typeof item === "object" && item.type === "separator";
|
|
925
|
+
}
|
|
926
|
+
function isToolbarGroupMenuButton(item) {
|
|
927
|
+
return !isGroupItemSeparator(item);
|
|
928
|
+
}
|
|
929
|
+
function groupItemDefinitionsToMenuEntries(items) {
|
|
930
|
+
return items.flatMap((item) => {
|
|
931
|
+
if (isGroupItemSeparator(item)) return [{ type: "separator" }];
|
|
932
|
+
if (!isToolbarGroupMenuButton(item)) return [];
|
|
933
|
+
return [{
|
|
934
|
+
type: "item",
|
|
935
|
+
name: item
|
|
936
|
+
}];
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
function getToolbarGroupMenuButtons(group) {
|
|
940
|
+
return getToolbarGroupMenuItems(group).filter((entry) => entry.type === "item").map((entry) => entry.name);
|
|
941
|
+
}
|
|
942
|
+
function normalizeButtonName(value) {
|
|
943
|
+
return isTiptapButtonName(value) ? value : null;
|
|
944
|
+
}
|
|
945
|
+
function normalizeHeadingLevels(value) {
|
|
946
|
+
if (!Array.isArray(value)) return;
|
|
947
|
+
const levels = value.map((level) => Number(level)).filter((level) => [
|
|
948
|
+
1,
|
|
949
|
+
2,
|
|
950
|
+
3,
|
|
951
|
+
4,
|
|
952
|
+
5,
|
|
953
|
+
6
|
|
954
|
+
].includes(level));
|
|
955
|
+
return levels.length > 0 ? levels : void 0;
|
|
956
|
+
}
|
|
957
|
+
function normalizeToolbarGroup(raw) {
|
|
958
|
+
const source = typeof raw.group === "object" && raw.group !== null ? raw.group : raw;
|
|
959
|
+
const preset = typeof source.preset === "string" ? source.preset : void 0;
|
|
960
|
+
const label = typeof source.label === "string" ? source.label : void 0;
|
|
961
|
+
const iconRaw = typeof source.icon === "string" ? source.icon : void 0;
|
|
962
|
+
const icon = iconRaw ? normalizeButtonName(iconRaw) ?? void 0 : void 0;
|
|
963
|
+
const headingLevels = normalizeHeadingLevels(source.headingLevels);
|
|
964
|
+
const items = Array.isArray(source.items) ? normalizeGroupItemDefinitions(source.items) : void 0;
|
|
965
|
+
if (!preset && !items?.length) return null;
|
|
966
|
+
if (preset && !VALID_PRESETS.has(preset)) return null;
|
|
967
|
+
return {
|
|
968
|
+
type: "group",
|
|
969
|
+
group: {
|
|
970
|
+
...label ? { label } : {},
|
|
971
|
+
...icon ? { icon } : {},
|
|
972
|
+
...preset ? { preset } : {},
|
|
973
|
+
...items?.length ? { items } : {},
|
|
974
|
+
...headingLevels ? { headingLevels } : {}
|
|
975
|
+
}
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
function normalizeToolbarNode(raw) {
|
|
979
|
+
if (typeof raw === "string") {
|
|
980
|
+
const token = raw.trim();
|
|
981
|
+
if (!token) return null;
|
|
982
|
+
if (isToolbarSeparatorToken(token)) return { type: "separator" };
|
|
983
|
+
const buttonName = normalizeButtonName(token);
|
|
984
|
+
return buttonName ? {
|
|
985
|
+
type: "button",
|
|
986
|
+
name: buttonName
|
|
987
|
+
} : null;
|
|
988
|
+
}
|
|
989
|
+
if (!raw || typeof raw !== "object") return null;
|
|
990
|
+
const record = raw;
|
|
991
|
+
if (record.type === "separator") return { type: "separator" };
|
|
992
|
+
if (record.type === "button" && typeof record.name === "string") {
|
|
993
|
+
const buttonName = normalizeButtonName(record.name);
|
|
994
|
+
return buttonName ? {
|
|
995
|
+
type: "button",
|
|
996
|
+
name: buttonName
|
|
997
|
+
} : null;
|
|
998
|
+
}
|
|
999
|
+
if (record.type === "group" || record.preset || record.items || record.group) return normalizeToolbarGroup(record);
|
|
1000
|
+
if (typeof record.button === "string") {
|
|
1001
|
+
const buttonName = normalizeButtonName(record.button);
|
|
1002
|
+
return buttonName ? {
|
|
1003
|
+
type: "button",
|
|
1004
|
+
name: buttonName
|
|
1005
|
+
} : null;
|
|
1006
|
+
}
|
|
1007
|
+
return null;
|
|
1008
|
+
}
|
|
1009
|
+
function normalizeToolbarNodes(raw) {
|
|
1010
|
+
return raw.map((item) => normalizeToolbarNode(item)).filter((item) => item !== null);
|
|
1011
|
+
}
|
|
1012
|
+
function parseToolbarConfig(input) {
|
|
1013
|
+
if (input === null || input === void 0 || input === "") return [{
|
|
1014
|
+
type: "button",
|
|
1015
|
+
name: "bold"
|
|
1016
|
+
}, {
|
|
1017
|
+
type: "button",
|
|
1018
|
+
name: "italic"
|
|
1019
|
+
}];
|
|
1020
|
+
if (Array.isArray(input)) {
|
|
1021
|
+
const normalized = normalizeToolbarNodes(input);
|
|
1022
|
+
return normalized.length > 0 ? normalized : [{
|
|
1023
|
+
type: "button",
|
|
1024
|
+
name: "bold"
|
|
1025
|
+
}, {
|
|
1026
|
+
type: "button",
|
|
1027
|
+
name: "italic"
|
|
1028
|
+
}];
|
|
1029
|
+
}
|
|
1030
|
+
if (typeof input === "string") {
|
|
1031
|
+
const trimmed = input.trim();
|
|
1032
|
+
if (!trimmed) return [{
|
|
1033
|
+
type: "button",
|
|
1034
|
+
name: "bold"
|
|
1035
|
+
}, {
|
|
1036
|
+
type: "button",
|
|
1037
|
+
name: "italic"
|
|
1038
|
+
}];
|
|
1039
|
+
if (trimmed.startsWith("[")) try {
|
|
1040
|
+
const parsed = JSON.parse(trimmed);
|
|
1041
|
+
return Array.isArray(parsed) ? parseToolbarConfig(parsed) : parseToolbarConfig(null);
|
|
1042
|
+
} catch {
|
|
1043
|
+
return parseToolbarConfig(null);
|
|
1044
|
+
}
|
|
1045
|
+
return parseToolbarConfig(trimmed.split(",").map((token) => token.trim()).filter(Boolean));
|
|
1046
|
+
}
|
|
1047
|
+
return parseToolbarConfig(null);
|
|
1048
|
+
}
|
|
1049
|
+
function runToolbarButton(editor, buttonName, options = {}) {
|
|
1050
|
+
if (buttonName === "paragraph") return editor.chain().focus().setParagraph().run();
|
|
1051
|
+
return runTiptapButton(editor, buttonName, options);
|
|
1052
|
+
}
|
|
1053
|
+
function isToolbarButtonActive(editor, buttonName) {
|
|
1054
|
+
if (buttonName === "paragraph") return editor.isActive("paragraph") && !editor.isActive("heading");
|
|
1055
|
+
return isTiptapButtonActive(editor, buttonName);
|
|
1056
|
+
}
|
|
1057
|
+
function getActiveHeadingLevel(editor) {
|
|
1058
|
+
for (const level of [
|
|
1059
|
+
1,
|
|
1060
|
+
2,
|
|
1061
|
+
3,
|
|
1062
|
+
4,
|
|
1063
|
+
5,
|
|
1064
|
+
6
|
|
1065
|
+
]) if (editor.isActive("heading", { level })) return level;
|
|
1066
|
+
return null;
|
|
1067
|
+
}
|
|
1068
|
+
function getToolbarGroupTriggerState(editor, group) {
|
|
1069
|
+
const fallbackIcon = group.icon ?? getToolbarGroupDefaultIcon(group);
|
|
1070
|
+
const menuButtons = getToolbarGroupMenuButtons(group);
|
|
1071
|
+
if (isHeadingsOnlyToolbarPreset(group.preset)) {
|
|
1072
|
+
const activeLevel = getActiveHeadingLevel(editor);
|
|
1073
|
+
if (activeLevel) {
|
|
1074
|
+
const name = `h${activeLevel}`;
|
|
1075
|
+
return {
|
|
1076
|
+
activeName: name,
|
|
1077
|
+
label: `H${activeLevel}`,
|
|
1078
|
+
isActive: true,
|
|
1079
|
+
icon: name
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
return {
|
|
1083
|
+
activeName: null,
|
|
1084
|
+
label: "",
|
|
1085
|
+
isActive: false,
|
|
1086
|
+
icon: "heading"
|
|
1087
|
+
};
|
|
1088
|
+
}
|
|
1089
|
+
if (isFormattingToolbarPreset(group.preset)) {
|
|
1090
|
+
const activeLevel = getActiveHeadingLevel(editor);
|
|
1091
|
+
if (activeLevel) {
|
|
1092
|
+
const name = `h${activeLevel}`;
|
|
1093
|
+
return {
|
|
1094
|
+
activeName: name,
|
|
1095
|
+
label: `H${activeLevel}`,
|
|
1096
|
+
isActive: true,
|
|
1097
|
+
icon: name
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
if (isToolbarButtonActive(editor, "blockquote")) return {
|
|
1101
|
+
activeName: "blockquote",
|
|
1102
|
+
label: "",
|
|
1103
|
+
isActive: true,
|
|
1104
|
+
icon: "blockquote"
|
|
1105
|
+
};
|
|
1106
|
+
if (isToolbarButtonActive(editor, "code-block")) return {
|
|
1107
|
+
activeName: "code-block",
|
|
1108
|
+
label: "",
|
|
1109
|
+
isActive: true,
|
|
1110
|
+
icon: "code-block"
|
|
1111
|
+
};
|
|
1112
|
+
return {
|
|
1113
|
+
activeName: "paragraph",
|
|
1114
|
+
label: "Text",
|
|
1115
|
+
isActive: isToolbarButtonActive(editor, "paragraph"),
|
|
1116
|
+
icon: "paragraph"
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
const activeName = menuButtons.find((name) => isToolbarButtonActive(editor, name)) ?? null;
|
|
1120
|
+
if (activeName) {
|
|
1121
|
+
const icon = activeName === "paragraph" ? "paragraph" : isTiptapButtonName(activeName) ? activeName : fallbackIcon;
|
|
1122
|
+
return {
|
|
1123
|
+
activeName: activeName === "paragraph" ? "paragraph" : activeName,
|
|
1124
|
+
label: activeName === "paragraph" ? "Text" : group.label ?? activeName,
|
|
1125
|
+
isActive: true,
|
|
1126
|
+
icon
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
return {
|
|
1130
|
+
activeName: null,
|
|
1131
|
+
label: group.label ?? "",
|
|
1132
|
+
isActive: false,
|
|
1133
|
+
icon: fallbackIcon
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
function getFormattingHeadingLevels(group) {
|
|
1137
|
+
return group.headingLevels ?? DEFAULT_HEADING_LEVELS;
|
|
1138
|
+
}
|
|
1139
|
+
function getFormattingMenuEntries(group) {
|
|
1140
|
+
return [
|
|
1141
|
+
{
|
|
1142
|
+
type: "item",
|
|
1143
|
+
name: "paragraph"
|
|
1144
|
+
},
|
|
1145
|
+
{ type: "separator" },
|
|
1146
|
+
...getFormattingHeadingLevels(group).map((level) => ({
|
|
1147
|
+
type: "item",
|
|
1148
|
+
name: `h${level}`
|
|
1149
|
+
})),
|
|
1150
|
+
{ type: "separator" },
|
|
1151
|
+
{
|
|
1152
|
+
type: "item",
|
|
1153
|
+
name: "blockquote"
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
type: "item",
|
|
1157
|
+
name: "code-block"
|
|
1158
|
+
}
|
|
1159
|
+
];
|
|
1160
|
+
}
|
|
1161
|
+
function getToolbarGroupMenuItems(group) {
|
|
1162
|
+
if (group.items?.length) return groupItemDefinitionsToMenuEntries(group.items);
|
|
1163
|
+
if (isFormattingToolbarPreset(group.preset)) return getFormattingMenuEntries(group);
|
|
1164
|
+
return getToolbarGroupItems(group).map((name) => ({
|
|
1165
|
+
type: "item",
|
|
1166
|
+
name
|
|
1167
|
+
}));
|
|
1168
|
+
}
|
|
1169
|
+
//#endregion
|
|
1170
|
+
//#region src/components/tiptap/variable-tag-node-view.ts
|
|
1171
|
+
/** Match kit v1 VariableTagView chip chrome (indigo + remove). */
|
|
1172
|
+
var REMOVE_ICON = `
|
|
1173
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" width="10" height="10" aria-hidden="true" focusable="false">
|
|
1174
|
+
<path fill="currentColor" d="M2.1 1.4 5 4.3l2.9-2.9.7.7L5.7 5l2.9 2.9-.7.7L5 5.7l-2.9 2.9-.7-.7L4.3 5 1.4 2.1z"/>
|
|
1175
|
+
</svg>
|
|
1176
|
+
`.trim();
|
|
1177
|
+
var PK_VARIABLE_TAG_CONFIGURE_EVENT = "pk-variable-tag-configure";
|
|
1178
|
+
var findTiptapHost = (viewDom) => {
|
|
1179
|
+
let node = viewDom;
|
|
1180
|
+
while (node) {
|
|
1181
|
+
if (node instanceof HTMLElement && node.localName.startsWith("pk-tiptap")) return node;
|
|
1182
|
+
node = node.parentNode instanceof ShadowRoot ? node.parentNode.host : node.parentNode;
|
|
1183
|
+
}
|
|
1184
|
+
return null;
|
|
1185
|
+
};
|
|
1186
|
+
var emitConfigure = (editor, detail) => {
|
|
1187
|
+
const viewDom = editor.view.dom;
|
|
1188
|
+
const host = findTiptapHost(viewDom);
|
|
1189
|
+
const configure = host && "variableTagConfigure" in host ? host.variableTagConfigure : null;
|
|
1190
|
+
if (typeof configure === "function") configure(detail);
|
|
1191
|
+
(host ?? viewDom).dispatchEvent(new CustomEvent(PK_VARIABLE_TAG_CONFIGURE_EVENT, {
|
|
1192
|
+
bubbles: true,
|
|
1193
|
+
composed: true,
|
|
1194
|
+
detail
|
|
1195
|
+
}));
|
|
1196
|
+
};
|
|
1197
|
+
/**
|
|
1198
|
+
* DOM NodeViewRendererProps do NOT include React's `deleteNode` / `updateAttributes`
|
|
1199
|
+
* (those live on NodeViewProps for ReactNodeViewRenderer only). Build them from
|
|
1200
|
+
* editor + getPos — same operations ReactNodeViewRenderer wires for VariableTagView.
|
|
1201
|
+
*/
|
|
1202
|
+
function createNodeViewCommands(editor, getPos) {
|
|
1203
|
+
const resolvePos = () => {
|
|
1204
|
+
const pos = typeof getPos === "function" ? getPos() : getPos;
|
|
1205
|
+
return typeof pos === "number" ? pos : void 0;
|
|
1206
|
+
};
|
|
1207
|
+
const deleteNode = () => {
|
|
1208
|
+
const pos = resolvePos();
|
|
1209
|
+
if (typeof pos !== "number") return;
|
|
1210
|
+
const live = editor.state.doc.nodeAt(pos);
|
|
1211
|
+
if (!live || live.type.name !== "variableTag") return;
|
|
1212
|
+
editor.chain().focus().deleteRange({
|
|
1213
|
+
from: pos,
|
|
1214
|
+
to: pos + live.nodeSize
|
|
1215
|
+
}).run();
|
|
1216
|
+
};
|
|
1217
|
+
const updateAttributes = (attributes) => {
|
|
1218
|
+
const pos = resolvePos();
|
|
1219
|
+
if (typeof pos !== "number") return;
|
|
1220
|
+
const live = editor.state.doc.nodeAt(pos);
|
|
1221
|
+
if (!live || live.type.name !== "variableTag") return;
|
|
1222
|
+
editor.chain().command(({ tr, dispatch }) => {
|
|
1223
|
+
if (dispatch) tr.setNodeMarkup(pos, void 0, {
|
|
1224
|
+
...live.attrs,
|
|
1225
|
+
...attributes
|
|
1226
|
+
});
|
|
1227
|
+
return true;
|
|
1228
|
+
}).run();
|
|
1229
|
+
};
|
|
1230
|
+
return {
|
|
1231
|
+
deleteNode,
|
|
1232
|
+
updateAttributes,
|
|
1233
|
+
resolvePos
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* DOM node view for variable tags in vanilla editors.
|
|
1238
|
+
* Chip + remove match kit v1; configure UI is opened via `pk-variable-tag-configure`
|
|
1239
|
+
* (Formie mounts the edit overlay beside the WC editor).
|
|
1240
|
+
*/
|
|
1241
|
+
function createVariableTagDomNodeView() {
|
|
1242
|
+
return (props) => {
|
|
1243
|
+
const { editor, getPos } = props;
|
|
1244
|
+
const { deleteNode, updateAttributes, resolvePos } = createNodeViewCommands(editor, getPos);
|
|
1245
|
+
let currentNode = props.node;
|
|
1246
|
+
const syncUnresolvedPresentation = (attrs) => {
|
|
1247
|
+
const unresolved = Boolean(attrs.unresolved);
|
|
1248
|
+
const token = String(attrs.value ?? "");
|
|
1249
|
+
const chipLabel = String(attrs.label || attrs.value || "");
|
|
1250
|
+
dom.classList.toggle("pk-variable-tag--unresolved", unresolved);
|
|
1251
|
+
if (unresolved) {
|
|
1252
|
+
dom.dataset.unresolved = "true";
|
|
1253
|
+
dom.title = token ? `Unknown or missing reference — ${token}` : "Unknown or missing reference";
|
|
1254
|
+
label.setAttribute("aria-invalid", "true");
|
|
1255
|
+
} else {
|
|
1256
|
+
delete dom.dataset.unresolved;
|
|
1257
|
+
dom.removeAttribute("title");
|
|
1258
|
+
label.removeAttribute("aria-invalid");
|
|
1259
|
+
}
|
|
1260
|
+
label.textContent = chipLabel;
|
|
1261
|
+
};
|
|
1262
|
+
const dom = document.createElement("span");
|
|
1263
|
+
dom.className = "pk-variable-tag";
|
|
1264
|
+
dom.id = uniqueId("pk-variable-tag");
|
|
1265
|
+
dom.setAttribute("contenteditable", "false");
|
|
1266
|
+
dom.setAttribute("data-drag-handle", "");
|
|
1267
|
+
dom.dataset.label = String(currentNode.attrs.label ?? "");
|
|
1268
|
+
dom.dataset.variableValue = String(currentNode.attrs.value ?? "");
|
|
1269
|
+
const label = document.createElement("button");
|
|
1270
|
+
label.type = "button";
|
|
1271
|
+
label.className = "pk-variable-tag__label";
|
|
1272
|
+
label.draggable = false;
|
|
1273
|
+
dom.append(label);
|
|
1274
|
+
syncUnresolvedPresentation(currentNode.attrs);
|
|
1275
|
+
let removeButton = null;
|
|
1276
|
+
let openOnInsertHandled = false;
|
|
1277
|
+
let openedAt = 0;
|
|
1278
|
+
const readLiveAttrs = () => {
|
|
1279
|
+
const pos = resolvePos();
|
|
1280
|
+
if (typeof pos === "number") {
|
|
1281
|
+
const live = editor.state.doc.nodeAt(pos);
|
|
1282
|
+
if (live?.type.name === "variableTag") return { ...live.attrs };
|
|
1283
|
+
}
|
|
1284
|
+
return { ...currentNode.attrs };
|
|
1285
|
+
};
|
|
1286
|
+
const openConfigure = () => {
|
|
1287
|
+
if (!editor.isEditable) return;
|
|
1288
|
+
const now = Date.now();
|
|
1289
|
+
if (now - openedAt < 300) return;
|
|
1290
|
+
openedAt = now;
|
|
1291
|
+
dom.removeAttribute("draggable");
|
|
1292
|
+
emitConfigure(editor, {
|
|
1293
|
+
editor,
|
|
1294
|
+
anchor: dom,
|
|
1295
|
+
attrs: readLiveAttrs(),
|
|
1296
|
+
getPos: resolvePos,
|
|
1297
|
+
updateAttributes,
|
|
1298
|
+
deleteNode
|
|
1299
|
+
});
|
|
1300
|
+
};
|
|
1301
|
+
label.addEventListener("pointerdown", (event) => {
|
|
1302
|
+
if (event.button !== 0) return;
|
|
1303
|
+
event.preventDefault();
|
|
1304
|
+
event.stopPropagation();
|
|
1305
|
+
openConfigure();
|
|
1306
|
+
});
|
|
1307
|
+
label.addEventListener("click", (event) => {
|
|
1308
|
+
event.preventDefault();
|
|
1309
|
+
event.stopPropagation();
|
|
1310
|
+
openConfigure();
|
|
1311
|
+
});
|
|
1312
|
+
const syncRemoveButton = (editable) => {
|
|
1313
|
+
if (editable) {
|
|
1314
|
+
if (removeButton) return;
|
|
1315
|
+
removeButton = document.createElement("button");
|
|
1316
|
+
removeButton.type = "button";
|
|
1317
|
+
removeButton.className = "pk-variable-tag__remove";
|
|
1318
|
+
removeButton.setAttribute("aria-label", "Remove");
|
|
1319
|
+
removeButton.draggable = false;
|
|
1320
|
+
removeButton.innerHTML = REMOVE_ICON;
|
|
1321
|
+
removeButton.addEventListener("pointerdown", (event) => {
|
|
1322
|
+
event.preventDefault();
|
|
1323
|
+
event.stopPropagation();
|
|
1324
|
+
});
|
|
1325
|
+
removeButton.addEventListener("click", (event) => {
|
|
1326
|
+
event.preventDefault();
|
|
1327
|
+
event.stopPropagation();
|
|
1328
|
+
deleteNode();
|
|
1329
|
+
});
|
|
1330
|
+
dom.append(removeButton);
|
|
1331
|
+
return;
|
|
1332
|
+
}
|
|
1333
|
+
removeButton?.remove();
|
|
1334
|
+
removeButton = null;
|
|
1335
|
+
};
|
|
1336
|
+
syncRemoveButton(editor.isEditable);
|
|
1337
|
+
if (currentNode.attrs.openOnInsert && editor.isEditable && !openOnInsertHandled) {
|
|
1338
|
+
openOnInsertHandled = true;
|
|
1339
|
+
queueMicrotask(() => {
|
|
1340
|
+
updateAttributes({ openOnInsert: false });
|
|
1341
|
+
openConfigure();
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
return {
|
|
1345
|
+
dom,
|
|
1346
|
+
stopEvent: (event) => {
|
|
1347
|
+
const target = event.target;
|
|
1348
|
+
if (!(target instanceof Element)) return false;
|
|
1349
|
+
return Boolean(target.closest(".pk-variable-tag__label") || target.closest(".pk-variable-tag__remove"));
|
|
1350
|
+
},
|
|
1351
|
+
selectNode: () => {
|
|
1352
|
+
dom.classList.add("ProseMirror-selectednode");
|
|
1353
|
+
dom.removeAttribute("draggable");
|
|
1354
|
+
},
|
|
1355
|
+
deselectNode: () => {
|
|
1356
|
+
dom.classList.remove("ProseMirror-selectednode");
|
|
1357
|
+
dom.removeAttribute("draggable");
|
|
1358
|
+
},
|
|
1359
|
+
update(updatedNode) {
|
|
1360
|
+
if (updatedNode.type.name !== "variableTag") return false;
|
|
1361
|
+
currentNode = updatedNode;
|
|
1362
|
+
dom.dataset.label = String(updatedNode.attrs.label ?? "");
|
|
1363
|
+
dom.dataset.variableValue = String(updatedNode.attrs.value ?? "");
|
|
1364
|
+
syncUnresolvedPresentation(updatedNode.attrs);
|
|
1365
|
+
syncRemoveButton(editor.isEditable);
|
|
1366
|
+
return true;
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
//#endregion
|
|
1372
|
+
//#region src/components/tiptap/tiptap.styles.ts
|
|
1373
|
+
/**
|
|
1374
|
+
* Indigo chip matching kit v1 VariableTagView (`bg-[#5C6BC0] text-white rounded-[2px]`).
|
|
1375
|
+
* Shared by rich editor + single-line input ProseMirror hosts.
|
|
1376
|
+
*/
|
|
1377
|
+
var variableTagStyles = i`
|
|
1378
|
+
.pk-variable-tag {
|
|
1379
|
+
position: relative;
|
|
1380
|
+
display: inline-flex;
|
|
1381
|
+
align-items: stretch;
|
|
1382
|
+
max-width: 100%;
|
|
1383
|
+
margin-inline: 1px;
|
|
1384
|
+
margin-block-start: -3px;
|
|
1385
|
+
padding: 0;
|
|
1386
|
+
border-radius: 2px;
|
|
1387
|
+
background: #5c6bc0;
|
|
1388
|
+
color: #fff;
|
|
1389
|
+
font-size: 11px;
|
|
1390
|
+
font-weight: 400;
|
|
1391
|
+
line-height: 1;
|
|
1392
|
+
white-space: nowrap;
|
|
1393
|
+
vertical-align: middle;
|
|
1394
|
+
overflow: hidden;
|
|
1395
|
+
cursor: default;
|
|
1396
|
+
box-sizing: border-box;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
/* Unresolved / missing reference — muted grey (not alarm yellow). */
|
|
1400
|
+
.pk-variable-tag--unresolved {
|
|
1401
|
+
background: var(--pk-color-gray-100, #f3f4f6);
|
|
1402
|
+
color: var(--pk-color-gray-600, #4b5563);
|
|
1403
|
+
box-shadow: inset 0 0 0 1px var(--pk-color-gray-300, #d1d5db);
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
.pk-variable-tag--unresolved.ProseMirror-selectednode {
|
|
1407
|
+
box-shadow:
|
|
1408
|
+
inset 0 0 0 1px var(--pk-color-gray-400, #9ca3af),
|
|
1409
|
+
0 0 0 2px rgba(156, 163, 175, 0.45);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
.pk-variable-tag.ProseMirror-selectednode {
|
|
1413
|
+
outline: none;
|
|
1414
|
+
box-shadow: 0 0 0 2px rgba(123, 140, 232, 0.5);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
.pk-variable-tag__label {
|
|
1418
|
+
display: inline-flex;
|
|
1419
|
+
align-items: center;
|
|
1420
|
+
max-width: 220px;
|
|
1421
|
+
margin: 0;
|
|
1422
|
+
padding: 4px 5px;
|
|
1423
|
+
border: 0;
|
|
1424
|
+
background: transparent;
|
|
1425
|
+
color: inherit;
|
|
1426
|
+
font: inherit;
|
|
1427
|
+
font-size: inherit;
|
|
1428
|
+
line-height: inherit;
|
|
1429
|
+
text-align: left;
|
|
1430
|
+
overflow: hidden;
|
|
1431
|
+
text-overflow: ellipsis;
|
|
1432
|
+
cursor: pointer;
|
|
1433
|
+
user-select: none;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
.pk-variable-tag__remove {
|
|
1437
|
+
display: inline-flex;
|
|
1438
|
+
align-items: center;
|
|
1439
|
+
justify-content: center;
|
|
1440
|
+
align-self: stretch;
|
|
1441
|
+
margin: 0;
|
|
1442
|
+
padding: 4px 5px 4px 4px;
|
|
1443
|
+
border: 0;
|
|
1444
|
+
background: transparent;
|
|
1445
|
+
color: inherit;
|
|
1446
|
+
cursor: pointer;
|
|
1447
|
+
line-height: 0;
|
|
1448
|
+
appearance: none;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
.pk-variable-tag__remove svg {
|
|
1452
|
+
display: block;
|
|
1453
|
+
width: 10px;
|
|
1454
|
+
height: 10px;
|
|
1455
|
+
pointer-events: none;
|
|
1456
|
+
}
|
|
1457
|
+
`;
|
|
1458
|
+
var tiptapProseMirrorStyles = i`
|
|
1459
|
+
@layer pk-component {
|
|
1460
|
+
.ProseMirror {
|
|
1461
|
+
outline: none;
|
|
1462
|
+
min-height: 2rem;
|
|
1463
|
+
padding: 1rem;
|
|
1464
|
+
background: rgb(251, 252, 254);
|
|
1465
|
+
/* Craft CP body text (~gray-700), not gray-900. */
|
|
1466
|
+
color: var(--pk-color-gray-700);
|
|
1467
|
+
font-family: var(--pk-font-family);
|
|
1468
|
+
/* Match pk-input / body (14px). sm (13px) matched field instructions and looked undersized vs v1. */
|
|
1469
|
+
font-size: var(--pk-font-size-base);
|
|
1470
|
+
line-height: 1.5;
|
|
1471
|
+
white-space: pre-wrap;
|
|
1472
|
+
box-sizing: border-box;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
.ProseMirror p {
|
|
1476
|
+
margin: 0 0 0.5rem;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
.ProseMirror p:last-child {
|
|
1480
|
+
margin-bottom: 0;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
.ProseMirror h1 {
|
|
1484
|
+
font-size: 1.25rem;
|
|
1485
|
+
font-weight: 700;
|
|
1486
|
+
margin: 0 0 0.5rem;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
.ProseMirror h2 {
|
|
1490
|
+
font-size: 1.125rem;
|
|
1491
|
+
font-weight: 600;
|
|
1492
|
+
margin: 0 0 0.5rem;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
.ProseMirror h3,
|
|
1496
|
+
.ProseMirror h4,
|
|
1497
|
+
.ProseMirror h5,
|
|
1498
|
+
.ProseMirror h6 {
|
|
1499
|
+
font-weight: 600;
|
|
1500
|
+
margin: 0 0 0.5rem;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
.ProseMirror a {
|
|
1504
|
+
color: var(--pk-color-blue-600);
|
|
1505
|
+
text-decoration: underline;
|
|
1506
|
+
cursor: pointer;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
.ProseMirror ul,
|
|
1510
|
+
.ProseMirror ol {
|
|
1511
|
+
margin: 0 0 0.5rem;
|
|
1512
|
+
padding-left: 1.25rem;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
.ProseMirror blockquote {
|
|
1516
|
+
margin: 0 0 0.5rem;
|
|
1517
|
+
padding-left: 0.75rem;
|
|
1518
|
+
border-left: 3px solid var(--pk-color-gray-300);
|
|
1519
|
+
color: var(--pk-color-gray-600);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
.ProseMirror code {
|
|
1523
|
+
font-family: var(--pk-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
|
|
1524
|
+
font-size: var(--pk-font-size-mono, 0.9em);
|
|
1525
|
+
line-height: var(--pk-line-height-mono, 1.5);
|
|
1526
|
+
background: var(--pk-color-gray-100);
|
|
1527
|
+
border-radius: 0.2rem;
|
|
1528
|
+
padding: 0.1rem 0.25rem;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
.ProseMirror pre {
|
|
1532
|
+
margin: 0 0 0.5rem;
|
|
1533
|
+
padding: 0.75rem;
|
|
1534
|
+
background: var(--pk-color-gray-900);
|
|
1535
|
+
color: var(--pk-color-gray-50);
|
|
1536
|
+
border-radius: var(--pk-radius-md);
|
|
1537
|
+
overflow-x: auto;
|
|
1538
|
+
font-family: var(--pk-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
|
|
1539
|
+
font-size: var(--pk-font-size-mono, 0.9em);
|
|
1540
|
+
line-height: var(--pk-line-height-mono, 1.5);
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
${variableTagStyles}
|
|
1544
|
+
}
|
|
1545
|
+
`;
|
|
1546
|
+
/**
|
|
1547
|
+
* Single-line TipTap field — same box metrics as `pk-input` .input
|
|
1548
|
+
* (14px / line-height 1.4 / padding 6px 8px).
|
|
1549
|
+
*
|
|
1550
|
+
* ProseMirror always injects `br.ProseMirror-trailingBreak` for the caret.
|
|
1551
|
+
* Never `display: none` it — that freezes one-liner docs after the first character.
|
|
1552
|
+
* Clip to one line height instead so the break cannot inflate the control.
|
|
1553
|
+
*/
|
|
1554
|
+
var tiptapInputProseMirrorStyles = i`
|
|
1555
|
+
@layer pk-component {
|
|
1556
|
+
.ProseMirror {
|
|
1557
|
+
outline: none;
|
|
1558
|
+
margin: 0;
|
|
1559
|
+
/* Match stock pk-input padding by default. Hosts can override density via
|
|
1560
|
+
* --pk-tiptap-input-* (light DOM cannot style .ProseMirror in the shadow tree).
|
|
1561
|
+
*/
|
|
1562
|
+
padding-block: var(--pk-tiptap-input-padding-block, 6px);
|
|
1563
|
+
padding-inline-start: var(--pk-tiptap-input-padding-inline-start, 8px);
|
|
1564
|
+
padding-inline-end: var(--pk-tiptap-input-padding-inline-end, 8px);
|
|
1565
|
+
/* One-liner clip: padding + control line-height (v1 text-sm), not a fixed shell token. */
|
|
1566
|
+
height: var(--pk-tiptap-input-height, calc(var(--pk-input-control-line-height, 1.25rem) + 12px));
|
|
1567
|
+
max-height: var(--pk-tiptap-input-height, calc(var(--pk-input-control-line-height, 1.25rem) + 12px));
|
|
1568
|
+
background: var(--pk-input-bg);
|
|
1569
|
+
/* Craft CP body / field value text. */
|
|
1570
|
+
color: var(--pk-color-gray-700);
|
|
1571
|
+
font-family: var(--pk-font-family);
|
|
1572
|
+
font-size: var(--pk-tiptap-input-font-size, var(--pk-font-size-base));
|
|
1573
|
+
line-height: var(--pk-tiptap-input-line-height, var(--pk-input-control-line-height, 1.25rem));
|
|
1574
|
+
white-space: nowrap;
|
|
1575
|
+
overflow-x: auto;
|
|
1576
|
+
overflow-y: hidden;
|
|
1577
|
+
box-sizing: border-box;
|
|
1578
|
+
scrollbar-width: none;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
.ProseMirror::-webkit-scrollbar {
|
|
1582
|
+
display: none;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
/* OneLinerDocument is inline-only; keep p inline if a schema ever wraps text. */
|
|
1586
|
+
.ProseMirror p {
|
|
1587
|
+
margin: 0;
|
|
1588
|
+
display: inline;
|
|
1589
|
+
line-height: inherit;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
/* Read-only display: no input padding/height box (v1 skipped chrome when readOnly).
|
|
1593
|
+
* Inherit color/weight so list name links (text-blue-600 font-bold) show through. */
|
|
1594
|
+
:host([readonly]) .ProseMirror {
|
|
1595
|
+
padding-block: 0;
|
|
1596
|
+
padding-inline: 0;
|
|
1597
|
+
height: auto;
|
|
1598
|
+
max-height: none;
|
|
1599
|
+
background: transparent;
|
|
1600
|
+
overflow: visible;
|
|
1601
|
+
white-space: normal;
|
|
1602
|
+
color: inherit;
|
|
1603
|
+
font-weight: inherit;
|
|
1604
|
+
font-size: inherit;
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
${variableTagStyles}
|
|
1608
|
+
}
|
|
1609
|
+
`;
|
|
1610
|
+
var tiptapContentProseMirrorStyles = i`
|
|
1611
|
+
@layer pk-component {
|
|
1612
|
+
/* Inherit host color/size so light-DOM wrappers (warning banners, badges)
|
|
1613
|
+
can restyle read-only TipTap without piercing the shadow tree. */
|
|
1614
|
+
.ProseMirror {
|
|
1615
|
+
outline: none;
|
|
1616
|
+
color: inherit;
|
|
1617
|
+
font-family: inherit;
|
|
1618
|
+
font-size: inherit;
|
|
1619
|
+
line-height: inherit;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
.ProseMirror p {
|
|
1623
|
+
margin: 0;
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
`;
|
|
1627
|
+
//#endregion
|
|
1628
|
+
export { createTiptapExtensions as A, contentToValue as C, getFatalTiptapContentError as D, valueToContent as E, normalizeContentArray as O, openCraftElementLinkSelector as S, flattenVariableOptions as T, getLinkOpenInNewTab as _, getToolbarGroupDefaultIcon as a, getCraftLinkOptions as b, isFormattingToolbarPreset as c, parseToolbarConfig as d, runToolbarButton as f, getLinkEditState as g, applyLinkToEditor as h, createVariableTagDomNodeView as i, createTiptapInputExtensions as j, valueToContent$1 as k, isHeadingsOnlyToolbarPreset as l, isTiptapButtonActive as m, tiptapInputProseMirrorStyles as n, getToolbarGroupMenuItems as o, toolbarIncludesButton as p, tiptapProseMirrorStyles as r, getToolbarGroupTriggerState as s, tiptapContentProseMirrorStyles as t, isToolbarButtonActive as u, getSelectedText as v, dedupeVariableOptions as w, getLinkOptionsElementSiteId as x, unsetLinkFromEditor as y };
|