@limetech/lime-elements 40.5.4 → 40.6.1
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 +18 -0
- package/dist/cjs/{adapt-color-contrast-Beo1IEl_.js → adapt-color-contrast-h6iwOfZd.js} +1 -1
- package/dist/cjs/{checkbox.template-BPk8WkQF.js → checkbox.template-CoNVC4Nf.js} +2 -2
- package/dist/cjs/{files-DI4jItxi.js → files-DpGigQ8k.js} +1 -1
- package/dist/cjs/{format-bytes-CpUKKU86.js → format-bytes-WTHVI718.js} +1 -4
- package/dist/cjs/{hotkeys-BtR8uxvl.js → hotkeys-D761KWnZ.js} +1 -0
- package/dist/cjs/{image-resize-CG2fitJT.js → image-resize-JlRLB97I.js} +1 -0
- package/dist/cjs/{image.template-DY7qwbuy.js → image.template-DlF-f23b.js} +1 -1
- package/dist/cjs/{index--B6-r0uo.js → index-BlsqxTB1.js} +1 -7
- package/dist/cjs/{index-ETPz91V5.js → index-zZvs6xK-.js} +9382 -9504
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{isArrayLikeObject-U2Ddbw4n.js → isArrayLikeObject-BhSkOTkw.js} +17 -0
- package/dist/cjs/{language-CaqPKPyW.js → language-v-MMS6ym.js} +1 -1
- package/dist/cjs/lime-elements.cjs.js +2 -2
- package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +2 -2
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +20 -18
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +5 -5
- package/dist/cjs/limel-badge.cjs.entry.js +3 -3
- package/dist/cjs/limel-banner.cjs.entry.js +2 -2
- package/dist/cjs/limel-breadcrumbs_6.cjs.entry.js +80 -80
- package/dist/cjs/limel-button-group.cjs.entry.js +3 -3
- package/dist/cjs/limel-button.cjs.entry.js +4 -4
- package/dist/cjs/limel-callout.cjs.entry.js +6 -6
- package/dist/cjs/limel-card.cjs.entry.js +8 -7
- package/dist/cjs/limel-chart.cjs.entry.js +5 -5
- package/dist/cjs/limel-checkbox.cjs.entry.js +12 -10
- package/dist/cjs/limel-chip-set.cjs.entry.js +30 -39
- package/dist/cjs/limel-chip_2.cjs.entry.js +9 -9
- package/dist/cjs/limel-circular-progress.cjs.entry.js +2 -2
- package/dist/cjs/limel-code-diff.cjs.entry.js +25 -28
- package/dist/cjs/limel-code-editor.cjs.entry.js +17 -12
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +8 -8
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +3 -3
- package/dist/cjs/limel-color-picker.cjs.entry.js +6 -5
- package/dist/cjs/limel-config.cjs.entry.js +3 -3
- package/dist/cjs/limel-date-picker.cjs.entry.js +8 -11
- package/dist/cjs/limel-dialog.cjs.entry.js +6 -9
- package/dist/cjs/limel-dock-button.cjs.entry.js +6 -11
- package/dist/cjs/limel-dock.cjs.entry.js +3 -3
- package/dist/cjs/limel-drag-handle.cjs.entry.js +6 -6
- package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
- package/dist/cjs/limel-email-viewer.cjs.entry.js +11 -17
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +11 -12
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1099 -1147
- package/dist/cjs/limel-file.cjs.entry.js +17 -16
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +100 -94
- package/dist/cjs/limel-flex-container.cjs.entry.js +2 -2
- package/dist/cjs/limel-form.cjs.entry.js +67 -68
- package/dist/cjs/limel-grid.cjs.entry.js +2 -2
- package/dist/cjs/limel-header.cjs.entry.js +2 -2
- package/dist/cjs/limel-help-content.cjs.entry.js +2 -2
- package/dist/cjs/limel-help.cjs.entry.js +3 -3
- package/dist/cjs/limel-helper-line_3.cjs.entry.js +12 -14
- package/dist/cjs/limel-hotkey_4.cjs.entry.js +23 -23
- package/dist/cjs/limel-icon-button.cjs.entry.js +4 -4
- package/dist/cjs/limel-icon.cjs.entry.js +15 -13
- package/dist/cjs/limel-info-tile.cjs.entry.js +10 -10
- package/dist/cjs/limel-list-item.cjs.entry.js +10 -10
- package/dist/cjs/limel-markdown.cjs.entry.js +50 -23
- package/dist/cjs/limel-masonry-layout.cjs.entry.js +6 -5
- package/dist/cjs/limel-menu-item-meta.cjs.entry.js +3 -3
- package/dist/cjs/limel-pagination-jump.cjs.entry.js +17 -15
- package/dist/cjs/limel-pagination.cjs.entry.js +10 -9
- package/dist/cjs/limel-picker.cjs.entry.js +31 -29
- package/dist/cjs/limel-popover_2.cjs.entry.js +25 -21
- package/dist/cjs/limel-profile-picture.cjs.entry.js +12 -11
- package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-progress-flow.cjs.entry.js +11 -10
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +476 -408
- package/dist/cjs/limel-radio-button-group.cjs.entry.js +2 -2
- package/dist/cjs/limel-radio-button.cjs.entry.js +3 -3
- package/dist/cjs/limel-scroller.cjs.entry.js +180 -0
- package/dist/cjs/limel-select.cjs.entry.js +17 -17
- package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
- package/dist/cjs/limel-slider.cjs.entry.js +18 -27
- package/dist/cjs/limel-snackbar.cjs.entry.js +5 -5
- package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js +3 -3
- package/dist/cjs/limel-tab-bar.cjs.entry.js +66 -97
- package/dist/cjs/limel-tab-panel.cjs.entry.js +12 -9
- package/dist/cjs/limel-table.cjs.entry.js +527 -106
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +15 -14
- package/dist/cjs/limel-text-editor.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{make-enter-clickable-NuTMC9MU.js → make-enter-clickable-BZHEWIJD.js} +19 -12
- package/dist/cjs/markdown-exporter-C-UW43FF.js +6210 -0
- package/dist/cjs/{markdown-parser-YH5HSSgF.js → markdown-parser-ssDij8_l.js} +603 -870
- package/dist/cjs/{moment-CqRdiK10.js → moment-Cfsz2WF1.js} +1062 -833
- package/dist/cjs/{random-string-BTzDB2ee.js → random-string-CFCtFh5l.js} +1 -0
- package/dist/cjs/{render-list-component-5ZKWpCnM.js → render-list-component-BtAliHQp.js} +3 -5
- package/dist/cjs/{sv-BSR4W58y.js → sv-Co78RX70.js} +31 -3
- package/dist/cjs/{translations-DFFpR6AZ.js → translations-CNTWud2a.js} +5 -8
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/3d-hover-effect-glow/3d-hover-effect-glow.js +1 -1
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js +8 -7
- package/dist/collection/components/action-bar/action-bar-item/action-bar-overflow-menu.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js +6 -5
- package/dist/collection/components/ai-avatar/ai-avatar.js +1 -1
- package/dist/collection/components/badge/badge.js +2 -2
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +2 -2
- package/dist/collection/components/button/button.js +2 -2
- package/dist/collection/components/button-group/button-group.js +1 -1
- package/dist/collection/components/callout/callout.js +1 -1
- package/dist/collection/components/card/card.js +6 -5
- package/dist/collection/components/checkbox/checkbox.js +9 -7
- package/dist/collection/components/checkbox/checkbox.template.js +1 -1
- package/dist/collection/components/chip/chip.js +1 -1
- package/dist/collection/components/chip-set/chip-set-input-helpers.js +18 -21
- package/dist/collection/components/chip-set/chip-set.js +7 -13
- package/dist/collection/components/circular-progress/circular-progress.js +1 -1
- package/dist/collection/components/code-diff/code-diff.js +19 -22
- package/dist/collection/components/code-diff/diff-engine.js +2 -2
- package/dist/collection/components/code-editor/code-editor.js +8 -3
- package/dist/collection/components/collapsible-section/collapsible-section.js +1 -1
- package/dist/collection/components/color-picker/color-picker-palette.js +2 -2
- package/dist/collection/components/color-picker/color-picker.js +5 -4
- package/dist/collection/components/config/config.js +2 -2
- package/dist/collection/components/date-picker/date-picker.js +3 -6
- package/dist/collection/components/date-picker/flatpickr-adapter/deferred-destroy.js +4 -3
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +1 -1
- package/dist/collection/components/date-picker/pickers/month-picker.js +40 -36
- package/dist/collection/components/date-picker/pickers/quarter-picker.js +35 -30
- package/dist/collection/components/date-picker/pickers/year-picker.js +16 -20
- package/dist/collection/components/dialog/dialog.js +4 -7
- package/dist/collection/components/dock/dock-button/dock-button.js +4 -9
- package/dist/collection/components/dock/dock.js +2 -2
- package/dist/collection/components/drag-handle/drag-handle.js +1 -1
- package/dist/collection/components/email-viewer/email-loader.js +14 -10
- package/dist/collection/components/email-viewer/email-viewer.js +1 -1
- package/dist/collection/components/email-viewer/sanitize-email-html.js +1 -4
- package/dist/collection/components/email-viewer/split-email-address-list.js +4 -10
- package/dist/collection/components/file/file.js +11 -10
- package/dist/collection/components/file-dropzone/file-dropzone.js +1 -1
- package/dist/collection/components/file-input/file-input.js +7 -8
- package/dist/collection/components/file-viewer/file-viewer.js +12 -9
- package/dist/collection/components/flex-container/flex-container.js +1 -1
- package/dist/collection/components/form/fields/schema-field.js +1 -1
- package/dist/collection/components/form/form.js +2 -5
- package/dist/collection/components/form/form.test-schemas.js +8 -10
- package/dist/collection/components/form/templates/array-field.js +7 -9
- package/dist/collection/components/form/templates/common.js +19 -19
- package/dist/collection/components/form/templates/object-field.js +1 -1
- package/dist/collection/components/form/validation-display.js +2 -2
- package/dist/collection/components/form/validators/format.js +1 -0
- package/dist/collection/components/form/widgets/code-editor.js +6 -9
- package/dist/collection/components/form/widgets/date-picker.js +1 -3
- package/dist/collection/components/grid/grid.js +1 -1
- package/dist/collection/components/header/header.js +1 -1
- package/dist/collection/components/help/help-content.js +1 -1
- package/dist/collection/components/help/help.js +2 -2
- package/dist/collection/components/helper-line/helper-line.js +3 -3
- package/dist/collection/components/hotkey/hotkey.js +1 -1
- package/dist/collection/components/icon/icon.js +11 -9
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/info-tile/info-tile.js +9 -9
- package/dist/collection/components/input-field/input-field.js +11 -11
- package/dist/collection/components/list/list-renderer.js +5 -7
- package/dist/collection/components/list/list.js +2 -2
- package/dist/collection/components/list-item/list-item.js +2 -2
- package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.js +1 -1
- package/dist/collection/components/markdown/hydrate-custom-elements.js +6 -5
- package/dist/collection/components/markdown/image-intersection-observer.js +9 -8
- package/dist/collection/components/markdown/image-markdown-plugin.js +9 -7
- package/dist/collection/components/markdown/link-markdown-plugin.js +11 -10
- package/dist/collection/components/markdown/markdown-exporter.js +186 -0
- package/dist/collection/components/markdown/markdown-parser.js +2 -3
- package/dist/collection/components/markdown/markdown.js +59 -6
- package/dist/collection/components/markdown/remove-empty-paragraphs-plugin.js +4 -5
- package/dist/collection/components/masonry-layout/masonry-layout.js +5 -4
- package/dist/collection/components/menu/menu.js +48 -46
- package/dist/collection/components/menu-list/menu-list-renderer.js +8 -8
- package/dist/collection/components/menu-list/menu-list.js +1 -1
- package/dist/collection/components/menu-surface/menu-surface.js +6 -8
- package/dist/collection/components/notched-outline/notched-outline.js +1 -1
- package/dist/collection/components/pagination/jump/pagination-jump.js +13 -11
- package/dist/collection/components/pagination/pagination.js +5 -4
- package/dist/collection/components/picker/picker.js +25 -23
- package/dist/collection/components/popover/popover.js +13 -10
- package/dist/collection/components/popover-surface/popover-surface.js +1 -1
- package/dist/collection/components/portal/contains.js +9 -8
- package/dist/collection/components/portal/portal.js +16 -16
- package/dist/collection/components/profile-picture/profile-picture.js +4 -3
- package/dist/collection/components/progress-flow/progress-flow.js +10 -9
- package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button.js +2 -2
- package/dist/collection/components/scroller/scroller.css +317 -0
- package/dist/collection/components/scroller/scroller.js +284 -0
- package/dist/collection/components/select/select.js +13 -11
- package/dist/collection/components/select/select.template.js +1 -3
- package/dist/collection/components/slider/get-percentage-class.js +9 -18
- package/dist/collection/components/slider/slider.js +2 -2
- package/dist/collection/components/tab-bar/tab-bar.css +7 -289
- package/dist/collection/components/tab-bar/tab-bar.js +59 -104
- package/dist/collection/components/tab-panel/tab-panel.js +11 -8
- package/dist/collection/components/table/columns.js +1 -3
- package/dist/collection/components/table/element-pool.js +1 -1
- package/dist/collection/components/table/table-selection.js +6 -5
- package/dist/collection/components/table/table.css +15 -17
- package/dist/collection/components/table/table.js +44 -39
- package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +11 -10
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-command-utils/list-utils.js +1 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/menu/menu-commands.js +6 -10
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/inserter.js +37 -40
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/image/node.js +2 -1
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/link/link-plugin.js +21 -20
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/menu-state-tracking-plugin.js +6 -5
- package/dist/collection/components/text-editor/prosemirror-adapter/plugins/trigger/factory-helpers/detect-trigger-removal.js +15 -14
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +40 -34
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/text-editor/utils/metadata-utils.js +1 -1
- package/dist/collection/components/text-editor/utils/plugin-factory.js +3 -3
- package/dist/collection/components/tooltip/tooltip-content.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/global/icon-cache/factory.js +2 -3
- package/dist/collection/global/icon-cache/in-memory-icon-cache.js +2 -0
- package/dist/collection/global/translations.js +1 -3
- package/dist/collection/translations/fr.js +3 -3
- package/dist/collection/util/adapt-color-contrast.js +1 -1
- package/dist/collection/util/files.js +1 -1
- package/dist/collection/util/format-bytes.js +1 -4
- package/dist/collection/util/hotkeys.js +1 -0
- package/dist/collection/util/image-resize.js +1 -0
- package/dist/collection/util/language.js +1 -1
- package/dist/collection/util/make-enter-clickable.js +19 -12
- package/dist/collection/util/random-string.js +1 -0
- package/dist/collection/util/render-list-component.js +2 -4
- package/dist/esm/{adapt-color-contrast-Dgcw_h7C.js → adapt-color-contrast-BQoih_t0.js} +1 -1
- package/dist/esm/{checkbox.template-Cx_3u92S.js → checkbox.template-IDyv2bgn.js} +2 -2
- package/dist/esm/{files-DnkFEKoB.js → files-CKnLqPDj.js} +1 -1
- package/dist/esm/{format-bytes-u_sd2HMb.js → format-bytes-24yUSW40.js} +1 -4
- package/dist/esm/{hotkeys-BxrRWYts.js → hotkeys-DjmlD0Mw.js} +1 -0
- package/dist/esm/{image-resize-BTSG--2-.js → image-resize-Dv2HOgWN.js} +1 -0
- package/dist/esm/{image.template-wqMwmOF-.js → image.template-BGjw97m_.js} +1 -1
- package/dist/esm/{index-CbciMfiU.js → index-BN64nlbO.js} +9369 -9505
- package/dist/esm/{index-Bnc9lzk2.js → index-BU9IJqli.js} +1 -7
- package/dist/esm/index.js +1 -1
- package/dist/esm/{isArrayLikeObject-CJB8HbtH.js → isArrayLikeObject-tmUOLOWr.js} +17 -1
- package/dist/esm/{language-C3hECvXE.js → language-ChagAaNf.js} +1 -1
- package/dist/esm/lime-elements.js +3 -3
- package/dist/esm/limel-3d-hover-effect-glow.entry.js +2 -2
- package/dist/esm/limel-action-bar_3.entry.js +20 -18
- package/dist/esm/limel-ai-avatar.entry.js +5 -5
- package/dist/esm/limel-badge.entry.js +3 -3
- package/dist/esm/limel-banner.entry.js +2 -2
- package/dist/esm/limel-breadcrumbs_6.entry.js +80 -80
- package/dist/esm/limel-button-group.entry.js +3 -3
- package/dist/esm/limel-button.entry.js +4 -4
- package/dist/esm/limel-callout.entry.js +6 -6
- package/dist/esm/limel-card.entry.js +8 -7
- package/dist/esm/limel-chart.entry.js +5 -5
- package/dist/esm/limel-checkbox.entry.js +12 -10
- package/dist/esm/limel-chip-set.entry.js +30 -39
- package/dist/esm/limel-chip_2.entry.js +9 -9
- package/dist/esm/limel-circular-progress.entry.js +2 -2
- package/dist/esm/limel-code-diff.entry.js +25 -28
- package/dist/esm/limel-code-editor.entry.js +17 -12
- package/dist/esm/limel-collapsible-section.entry.js +8 -8
- package/dist/esm/limel-color-picker-palette.entry.js +3 -3
- package/dist/esm/limel-color-picker.entry.js +6 -5
- package/dist/esm/limel-config.entry.js +3 -3
- package/dist/esm/limel-date-picker.entry.js +8 -11
- package/dist/esm/limel-dialog.entry.js +6 -9
- package/dist/esm/limel-dock-button.entry.js +6 -11
- package/dist/esm/limel-dock.entry.js +3 -3
- package/dist/esm/limel-drag-handle.entry.js +6 -6
- package/dist/esm/limel-dynamic-label.entry.js +1 -1
- package/dist/esm/limel-email-viewer.entry.js +11 -17
- package/dist/esm/limel-file-dropzone_2.entry.js +11 -12
- package/dist/esm/limel-file-viewer.entry.js +1099 -1147
- package/dist/esm/limel-file.entry.js +17 -16
- package/dist/esm/limel-flatpickr-adapter.entry.js +100 -94
- package/dist/esm/limel-flex-container.entry.js +2 -2
- package/dist/esm/limel-form.entry.js +66 -67
- package/dist/esm/limel-grid.entry.js +2 -2
- package/dist/esm/limel-header.entry.js +2 -2
- package/dist/esm/limel-help-content.entry.js +2 -2
- package/dist/esm/limel-help.entry.js +3 -3
- package/dist/esm/limel-helper-line_3.entry.js +12 -14
- package/dist/esm/limel-hotkey_4.entry.js +23 -23
- package/dist/esm/limel-icon-button.entry.js +4 -4
- package/dist/esm/limel-icon.entry.js +15 -13
- package/dist/esm/limel-info-tile.entry.js +10 -10
- package/dist/esm/limel-list-item.entry.js +10 -10
- package/dist/esm/limel-markdown.entry.js +50 -23
- package/dist/esm/limel-masonry-layout.entry.js +6 -5
- package/dist/esm/limel-menu-item-meta.entry.js +3 -3
- package/dist/esm/limel-pagination-jump.entry.js +17 -15
- package/dist/esm/limel-pagination.entry.js +10 -9
- package/dist/esm/limel-picker.entry.js +31 -29
- package/dist/esm/limel-popover_2.entry.js +25 -21
- package/dist/esm/limel-profile-picture.entry.js +12 -11
- package/dist/esm/limel-progress-flow-item.entry.js +1 -1
- package/dist/esm/limel-progress-flow.entry.js +11 -10
- package/dist/esm/limel-prosemirror-adapter.entry.js +476 -408
- package/dist/esm/limel-radio-button-group.entry.js +2 -2
- package/dist/esm/limel-radio-button.entry.js +3 -3
- package/dist/esm/limel-scroller.entry.js +178 -0
- package/dist/esm/limel-select.entry.js +17 -17
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-slider.entry.js +18 -27
- package/dist/esm/limel-snackbar.entry.js +5 -5
- package/dist/esm/limel-split-button.entry.js +1 -1
- package/dist/esm/limel-switch.entry.js +3 -3
- package/dist/esm/limel-tab-bar.entry.js +66 -97
- package/dist/esm/limel-tab-panel.entry.js +12 -9
- package/dist/esm/limel-table.entry.js +527 -106
- package/dist/esm/limel-text-editor-link-menu.entry.js +15 -14
- package/dist/esm/limel-text-editor.entry.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{make-enter-clickable-BgTwPGeH.js → make-enter-clickable-CIf8aGSd.js} +19 -12
- package/dist/esm/markdown-exporter-DblYRMhY.js +6208 -0
- package/dist/esm/{markdown-parser-DrxxGLF5.js → markdown-parser-CAPDx7i8.js} +530 -813
- package/dist/esm/{moment-DQRNe8qq.js → moment-_DadZLWp.js} +1062 -833
- package/dist/esm/{random-string-JbKhhoXs.js → random-string-BrjD-ITe.js} +1 -0
- package/dist/esm/{render-list-component-cicbMp0l.js → render-list-component-J1IzNpbv.js} +3 -5
- package/dist/esm/{sv-CY-6-yEp.js → sv-DpsDSi7k.js} +31 -3
- package/dist/esm/{translations-DMtX4tTX.js → translations-Y4i8PVc9.js} +5 -8
- package/dist/lime-elements/index.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-3916b316.entry.js → p-03cb609e.entry.js} +1 -1
- package/dist/lime-elements/p-05038bbb.entry.js +1 -0
- package/dist/lime-elements/{p-835149c4.entry.js → p-0d6925f4.entry.js} +1 -1
- package/dist/lime-elements/p-0e13ec91.entry.js +1 -0
- package/dist/lime-elements/p-159603cf.entry.js +159 -0
- package/dist/lime-elements/p-22fd1c87.entry.js +1 -0
- package/dist/lime-elements/p-24yUSW40.js +1 -0
- package/dist/lime-elements/{p-f717cd7a.entry.js → p-271662d4.entry.js} +1 -1
- package/dist/lime-elements/{p-c2a60508.entry.js → p-29c73bdf.entry.js} +1 -1
- package/dist/lime-elements/{p-deceda00.entry.js → p-2a902e77.entry.js} +1 -1
- package/dist/lime-elements/{p-d0cec424.entry.js → p-2b033dfa.entry.js} +1 -1
- package/dist/lime-elements/{p-acba5700.entry.js → p-2b2253d4.entry.js} +1 -1
- package/dist/lime-elements/p-2e33d2a4.entry.js +1 -0
- package/dist/lime-elements/p-31226737.entry.js +13 -0
- package/dist/lime-elements/{p-36ce4fbc.entry.js → p-31f314e6.entry.js} +1 -1
- package/dist/lime-elements/p-32a050a3.entry.js +1 -0
- package/dist/lime-elements/{p-3735111e.entry.js → p-3cfe0eaf.entry.js} +1 -1
- package/dist/lime-elements/{p-fbcd99a3.entry.js → p-3d3bdf45.entry.js} +1 -1
- package/dist/lime-elements/p-440a0b43.entry.js +1 -0
- package/dist/lime-elements/p-45c39fb4.entry.js +1 -0
- package/dist/lime-elements/p-45fde7a1.entry.js +1 -0
- package/dist/lime-elements/p-48afa6b7.entry.js +1 -0
- package/dist/lime-elements/{p-f04f7c8e.entry.js → p-4a88d365.entry.js} +1 -1
- package/dist/lime-elements/p-4b75e653.entry.js +1 -0
- package/dist/lime-elements/p-4dfd1962.entry.js +67 -0
- package/dist/lime-elements/{p-5698e493.entry.js → p-4ecbc9f4.entry.js} +1 -1
- package/dist/lime-elements/p-5386c629.entry.js +1 -0
- package/dist/lime-elements/{p-2e568c56.entry.js → p-54a9f48f.entry.js} +1 -1
- package/dist/lime-elements/{p-0fba64eb.entry.js → p-5df21b25.entry.js} +2 -2
- package/dist/lime-elements/{p-408c4dcb.entry.js → p-5f5c6e7d.entry.js} +1 -1
- package/dist/lime-elements/{p-052c3bc6.entry.js → p-681cb6de.entry.js} +1 -1
- package/dist/lime-elements/p-6adc7c88.entry.js +1 -0
- package/dist/lime-elements/{p-90df3e1b.entry.js → p-6d9961f7.entry.js} +1 -1
- package/dist/lime-elements/{p-74bd0c1a.entry.js → p-7b4351f6.entry.js} +1 -1
- package/dist/lime-elements/{p-3fd7e8aa.entry.js → p-7eab1341.entry.js} +1 -1
- package/dist/lime-elements/p-80153f45.entry.js +1 -0
- package/dist/lime-elements/{p-35fa1063.entry.js → p-85318636.entry.js} +1 -1
- package/dist/lime-elements/p-8988b7e1.entry.js +1 -0
- package/dist/lime-elements/{p-4ffbfc79.entry.js → p-8ac79ef5.entry.js} +1 -1
- package/dist/lime-elements/{p-4902fb3f.entry.js → p-9218fa6a.entry.js} +1 -1
- package/dist/lime-elements/p-92669910.entry.js +1 -0
- package/dist/lime-elements/{p-38b09f87.entry.js → p-9415411e.entry.js} +1 -1
- package/dist/lime-elements/p-95ccd9e7.entry.js +1 -0
- package/dist/lime-elements/{p-cb407bef.entry.js → p-9afa4721.entry.js} +1 -1
- package/dist/lime-elements/{p-54dcf46f.entry.js → p-9c8c2fb7.entry.js} +1 -1
- package/dist/lime-elements/{p-B8hoCfhT.js → p-B3YP9GOq.js} +1 -1
- package/dist/lime-elements/{p-Dgcw_h7C.js → p-BQoih_t0.js} +1 -1
- package/dist/lime-elements/{p-Bnc9lzk2.js → p-BU9IJqli.js} +1 -1
- package/dist/lime-elements/{p-CGVVDGcv.js → p-Bkvc4sus.js} +1 -1
- package/dist/lime-elements/p-Bvyt2bmV.js +1 -0
- package/dist/lime-elements/{p-BgTwPGeH.js → p-CIf8aGSd.js} +1 -1
- package/dist/lime-elements/{p-C3hECvXE.js → p-ChagAaNf.js} +1 -1
- package/dist/lime-elements/p-DTcfed02.js +3 -0
- package/dist/lime-elements/p-DWMfAkOE.js +1 -0
- package/dist/lime-elements/{p-BY85K-4J.js → p-DqQOawxc.js} +1 -1
- package/dist/lime-elements/p-I0PrvthC.js +7 -0
- package/dist/lime-elements/p-N9vxZMhe.js +1 -0
- package/dist/lime-elements/{p-DsDkl4Sy.js → p-ZDFVISfu.js} +3 -3
- package/dist/lime-elements/p-_UXAljNc.js +1 -0
- package/dist/lime-elements/p-a1c69e0c.entry.js +1 -0
- package/dist/lime-elements/{p-2daf0482.entry.js → p-a1d1470c.entry.js} +1 -1
- package/dist/lime-elements/{p-cef66e53.entry.js → p-a2e6f16e.entry.js} +1 -1
- package/dist/lime-elements/p-a550ba18.entry.js +1 -0
- package/dist/lime-elements/{p-d146feda.entry.js → p-a65eb58e.entry.js} +1 -1
- package/dist/lime-elements/p-ab8021b9.entry.js +1 -0
- package/dist/lime-elements/{p-03fb2603.entry.js → p-b22b52a1.entry.js} +1 -1
- package/dist/lime-elements/p-b6c0dc91.entry.js +23 -0
- package/dist/lime-elements/{p-c2a3ca7c.entry.js → p-b6d39581.entry.js} +1 -1
- package/dist/lime-elements/{p-8475a3b8.entry.js → p-c439b68b.entry.js} +1 -1
- package/dist/lime-elements/p-d19c7a3a.entry.js +1 -0
- package/dist/lime-elements/{p-7cbf50fc.entry.js → p-d1e5dd12.entry.js} +1 -1
- package/dist/lime-elements/p-de4719a6.entry.js +1 -0
- package/dist/lime-elements/{p-b81a2728.entry.js → p-e02e2c5f.entry.js} +1 -1
- package/dist/lime-elements/{p-d351b9ae.entry.js → p-e6a34047.entry.js} +1 -1
- package/dist/lime-elements/p-eF09GxA_.js +1 -0
- package/dist/lime-elements/{p-8fa9c9ea.entry.js → p-ee719744.entry.js} +1 -1
- package/dist/lime-elements/{p-d3bd4b80.entry.js → p-f04e2897.entry.js} +3 -3
- package/dist/lime-elements/p-f3cae1e7.entry.js +1 -0
- package/dist/lime-elements/{p-8115da75.entry.js → p-f4a0b1bc.entry.js} +1 -1
- package/dist/lime-elements/{p-4855dc9b.entry.js → p-f82f72e7.entry.js} +1 -1
- package/dist/lime-elements/{p-2d84ea04.entry.js → p-f97ec7a5.entry.js} +1 -1
- package/dist/lime-elements/{p-21109d9b.entry.js → p-fdd674fc.entry.js} +1 -1
- package/dist/lime-elements/{p-459eea13.entry.js → p-fdec09e9.entry.js} +1 -1
- package/dist/lime-elements/{p-2f57c3fa.entry.js → p-fe492ff3.entry.js} +1 -1
- package/dist/lime-elements/{p-65cded0e.entry.js → p-ff1a8b2e.entry.js} +1 -1
- package/dist/types/components/chip-set/chip-set-input-helpers.d.ts +1 -1
- package/dist/types/components/markdown/markdown-exporter.d.ts +15 -0
- package/dist/types/components/markdown/markdown.d.ts +19 -0
- package/dist/types/components/pagination/jump/pagination-jump.d.ts +1 -1
- package/dist/types/components/scroller/scroller.d.ts +67 -0
- package/dist/types/components/tab-bar/tab-bar.d.ts +13 -16
- package/dist/types/components.d.ts +138 -0
- package/dist/types/global/icon-cache/factory.d.ts +2 -2
- package/dist/types/global/shared-types/custom-element.types.d.ts +25 -0
- package/dist/types/global/translations.d.ts +2 -2
- package/package.json +18 -12
- package/dist/lime-elements/p-05afb316.entry.js +0 -1
- package/dist/lime-elements/p-10594468.entry.js +0 -1
- package/dist/lime-elements/p-19344984.entry.js +0 -13
- package/dist/lime-elements/p-1e93473a.entry.js +0 -1
- package/dist/lime-elements/p-26c5c6b9.entry.js +0 -1
- package/dist/lime-elements/p-452b9b01.entry.js +0 -1
- package/dist/lime-elements/p-4aae63bd.entry.js +0 -1
- package/dist/lime-elements/p-507cc8a1.entry.js +0 -159
- package/dist/lime-elements/p-531b6a64.entry.js +0 -1
- package/dist/lime-elements/p-54793c06.entry.js +0 -1
- package/dist/lime-elements/p-5d974afa.entry.js +0 -1
- package/dist/lime-elements/p-66b125f2.entry.js +0 -1
- package/dist/lime-elements/p-6d5b23ad.entry.js +0 -1
- package/dist/lime-elements/p-7e212fa7.entry.js +0 -1
- package/dist/lime-elements/p-82696d24.entry.js +0 -1
- package/dist/lime-elements/p-9ac39039.entry.js +0 -1
- package/dist/lime-elements/p-9b631363.entry.js +0 -1
- package/dist/lime-elements/p-C9xHOCE_.js +0 -7
- package/dist/lime-elements/p-DMNtoJ8I.js +0 -1
- package/dist/lime-elements/p-DQJU9gzh.js +0 -1
- package/dist/lime-elements/p-DpJgXIWf.js +0 -1
- package/dist/lime-elements/p-a1de9bbe.entry.js +0 -1
- package/dist/lime-elements/p-a71f6e87.entry.js +0 -67
- package/dist/lime-elements/p-bd7b3f8e.entry.js +0 -1
- package/dist/lime-elements/p-be8610ff.entry.js +0 -1
- package/dist/lime-elements/p-c72e5007.entry.js +0 -1
- package/dist/lime-elements/p-cafec335.entry.js +0 -1
- package/dist/lime-elements/p-d6dadc61.entry.js +0 -1
- package/dist/lime-elements/p-d93b7b9f.entry.js +0 -23
- package/dist/lime-elements/p-pk5KIdKH.js +0 -1
- package/dist/lime-elements/p-u_sd2HMb.js +0 -1
- package/dist/lime-elements/p-zo6O9LC9.js +0 -3
- /package/dist/lime-elements/{p-JbKhhoXs.js → p-BrjD-ITe.js} +0 -0
- /package/dist/lime-elements/{p-BxrRWYts.js → p-DjmlD0Mw.js} +0 -0
- /package/dist/lime-elements/{p-BTSG--2-.js → p-Dv2HOgWN.js} +0 -0
|
@@ -184,9 +184,11 @@ export class InputField {
|
|
|
184
184
|
if (this.type === 'number') {
|
|
185
185
|
props.step = this.step;
|
|
186
186
|
}
|
|
187
|
+
// eslint-disable-next-line unicorn/prefer-number-is-safe-integer -- integers beyond the safe range must still be applied
|
|
187
188
|
if (this.type === 'number' && Number.isInteger(this.min)) {
|
|
188
189
|
props.min = this.min;
|
|
189
190
|
}
|
|
191
|
+
// eslint-disable-next-line unicorn/prefer-number-is-safe-integer -- integers beyond the safe range must still be applied
|
|
190
192
|
if (this.type === 'number' && Number.isInteger(this.max)) {
|
|
191
193
|
props.max = this.max;
|
|
192
194
|
}
|
|
@@ -216,11 +218,11 @@ export class InputField {
|
|
|
216
218
|
};
|
|
217
219
|
this.renderHelperLine = () => {
|
|
218
220
|
var _a;
|
|
219
|
-
const text = this.getCurrentValue() || '';
|
|
220
|
-
const length = text.length;
|
|
221
221
|
if (!this.hasHelperLine()) {
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
+
const text = this.getCurrentValue() || '';
|
|
225
|
+
const length = text.length;
|
|
224
226
|
return (h("limel-helper-line", { helperTextId: this.helperTextId, helperText: (_a = this.helperText) !== null && _a !== void 0 ? _a : this.validationMessage, length: length, maxLength: this.maxlength, invalid: this.isInvalid() }));
|
|
225
227
|
};
|
|
226
228
|
this.renderSuffix = () => {
|
|
@@ -293,7 +295,7 @@ export class InputField {
|
|
|
293
295
|
if (!this.isInvalid() && this.hasLink()) {
|
|
294
296
|
return this.renderLinkIcon(this.getLink(), trailingIcon);
|
|
295
297
|
}
|
|
296
|
-
|
|
298
|
+
if (trailingIcon) {
|
|
297
299
|
return this.renderTrailingIcon(trailingIcon);
|
|
298
300
|
}
|
|
299
301
|
};
|
|
@@ -395,10 +397,11 @@ export class InputField {
|
|
|
395
397
|
listElement.focus();
|
|
396
398
|
return;
|
|
397
399
|
}
|
|
398
|
-
if (isUp) {
|
|
399
|
-
|
|
400
|
-
listElement.focus();
|
|
400
|
+
if (!isUp) {
|
|
401
|
+
return;
|
|
401
402
|
}
|
|
403
|
+
const listElement = list.shadowRoot.querySelector('.mdc-deprecated-list-item:last-child');
|
|
404
|
+
listElement.focus();
|
|
402
405
|
};
|
|
403
406
|
this.handleCompletionChange = (event) => {
|
|
404
407
|
event.stopPropagation();
|
|
@@ -594,13 +597,10 @@ export class InputField {
|
|
|
594
597
|
if (ariaControls) {
|
|
595
598
|
properties['aria-controls'] = ariaControls;
|
|
596
599
|
}
|
|
597
|
-
return (h(Host, { key: '
|
|
600
|
+
return (h(Host, { key: 'f75582060395fe9167939a30d0fb07a89d225cf2' }, h("limel-notched-outline", { key: '85e40d1ceee2efb56a7175f090b876b6514a41cb', labelId: this.labelId, label: this.label, required: this.required, invalid: this.invalid || this.isInvalid(), disabled: this.disabled, readonly: this.readonly, hasValue: !!this.value, hasLeadingIcon: !!this.leadingIcon }, h("label", { key: '683ee7c3e879a07f590ac27e8056489cb626b36f', slot: "content", class: this.getContainerClassList() }, this.renderLeadingIcon(), this.renderPrefix(), this.renderFormattedNumber(), this.renderInput(properties), this.renderSuffix(), this.renderTextarea(properties), this.renderTrailingLinkOrButton())), this.renderHelperLine(), this.renderAutocompleteList()));
|
|
598
601
|
}
|
|
599
602
|
valueWatcher(newValue) {
|
|
600
|
-
if (!this.mdcTextField) {
|
|
601
|
-
return;
|
|
602
|
-
}
|
|
603
|
-
if (this.changeWaiting) {
|
|
603
|
+
if (!this.mdcTextField || this.changeWaiting) {
|
|
604
604
|
return;
|
|
605
605
|
}
|
|
606
606
|
if (this.type === 'number' &&
|
|
@@ -14,9 +14,7 @@ export class ListRenderer {
|
|
|
14
14
|
if (role === 'listbox' || role === 'radiogroup') {
|
|
15
15
|
return 'vertical';
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
17
|
+
return null;
|
|
20
18
|
};
|
|
21
19
|
/**
|
|
22
20
|
* Determine which ListItem should have the `tab-index` attribute set,
|
|
@@ -29,12 +27,12 @@ export class ListRenderer {
|
|
|
29
27
|
*/
|
|
30
28
|
this.getIndexForWhichToApplyTabIndex = (items) => {
|
|
31
29
|
let result;
|
|
32
|
-
for (
|
|
33
|
-
if ('separator' in
|
|
30
|
+
for (const [i, entry] of items.entries()) {
|
|
31
|
+
if ('separator' in entry) {
|
|
34
32
|
// Ignore ListSeparator
|
|
35
33
|
}
|
|
36
34
|
else {
|
|
37
|
-
const item =
|
|
35
|
+
const item = entry;
|
|
38
36
|
if (item.disabled) {
|
|
39
37
|
// Skip disabled items - they should never get tabindex
|
|
40
38
|
continue;
|
|
@@ -92,7 +90,7 @@ export class ListRenderer {
|
|
|
92
90
|
};
|
|
93
91
|
}
|
|
94
92
|
render(items, config = {}) {
|
|
95
|
-
items
|
|
93
|
+
items || (items = []);
|
|
96
94
|
this.config = Object.assign(Object.assign({}, this.defaultConfig), config);
|
|
97
95
|
let role;
|
|
98
96
|
switch (this.config.type) {
|
|
@@ -189,12 +189,12 @@ export class List {
|
|
|
189
189
|
type: this.type,
|
|
190
190
|
iconSize: this.iconSize,
|
|
191
191
|
};
|
|
192
|
-
let maxLinesSecondaryText = +((_a = this.maxLinesSecondaryText) === null || _a === void 0 ? void 0 : _a.toFixed());
|
|
192
|
+
let maxLinesSecondaryText = +((_a = this.maxLinesSecondaryText) === null || _a === void 0 ? void 0 : _a.toFixed(0));
|
|
193
193
|
if (this.maxLinesSecondaryText < 1) {
|
|
194
194
|
maxLinesSecondaryText = 1;
|
|
195
195
|
}
|
|
196
196
|
const html = this.listRenderer.render(this.items, this.config);
|
|
197
|
-
return (h(Host, { key: '
|
|
197
|
+
return (h(Host, { key: 'b8c5f38d03402596fbd227a19587a801ef0c8b6e', style: {
|
|
198
198
|
'--maxLinesSecondaryText': `${maxLinesSecondaryText}`,
|
|
199
199
|
} }, html));
|
|
200
200
|
}
|
|
@@ -158,9 +158,9 @@ export class ListItemComponent {
|
|
|
158
158
|
// also keep for `menuitem` for visual state consistency
|
|
159
159
|
ariaProps['aria-selected'] = this.selected ? 'true' : 'false';
|
|
160
160
|
}
|
|
161
|
-
return (h(Host, Object.assign({ key: '
|
|
161
|
+
return (h(Host, Object.assign({ key: '005e6e5fa87bab94b1d3c00970ed4efff409de1b', role: this.getHostRole(), class: {
|
|
162
162
|
'has-primary-component': !!((_a = this.primaryComponent) === null || _a === void 0 ? void 0 : _a.name),
|
|
163
|
-
} }, ariaProps), this.renderRadioButton(), this.renderCheckbox(), this.renderIcon(), this.renderImage(), this.renderPrimaryComponent(), h("div", { key: '
|
|
163
|
+
} }, ariaProps), this.renderRadioButton(), this.renderCheckbox(), this.renderIcon(), this.renderImage(), this.renderPrimaryComponent(), h("div", { key: '351438e788b747b86a9700ab1a8c700532aee409', class: "text" }, this.renderLabel(), this.renderDescription()), this.renderActionMenu(this.actions)));
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Returns a stable reference for the provided actions array to avoid
|
|
@@ -22,7 +22,7 @@ export class MenuItemMeta {
|
|
|
22
22
|
this.showChevron = false;
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '6dbc3a71962933c5cfdf415096e41f90e84e7740' }, this.renderCommandText(), this.renderBadge(), this.renderChevron()));
|
|
26
26
|
}
|
|
27
27
|
renderCommandText() {
|
|
28
28
|
if (this.hotkey) {
|
|
@@ -32,12 +32,13 @@ function hydrateElement(element, attributes) {
|
|
|
32
32
|
continue;
|
|
33
33
|
}
|
|
34
34
|
const parsed = tryParseJson(value);
|
|
35
|
-
if (parsed
|
|
36
|
-
|
|
37
|
-
// Set the JS property (camelCase) instead of the attribute
|
|
38
|
-
const propName = attributeToPropName(attrName);
|
|
39
|
-
element[propName] = sanitized;
|
|
35
|
+
if (parsed === undefined) {
|
|
36
|
+
continue;
|
|
40
37
|
}
|
|
38
|
+
const sanitized = sanitizeUrls(parsed);
|
|
39
|
+
// Set the JS property (camelCase) instead of the attribute
|
|
40
|
+
const propName = attributeToPropName(attrName);
|
|
41
|
+
element[propName] = sanitized;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
function tryParseJson(value) {
|
|
@@ -5,15 +5,16 @@ export class ImageIntersectionObserver {
|
|
|
5
5
|
constructor(containerElement) {
|
|
6
6
|
this.handleIntersection = (entries) => {
|
|
7
7
|
for (const entry of entries) {
|
|
8
|
-
if (entry.isIntersecting) {
|
|
9
|
-
|
|
10
|
-
const dataSrc = img.dataset.src;
|
|
11
|
-
if (dataSrc) {
|
|
12
|
-
img.setAttribute('src', dataSrc);
|
|
13
|
-
delete img.dataset.src;
|
|
14
|
-
}
|
|
15
|
-
this.observer.unobserve(img);
|
|
8
|
+
if (!entry.isIntersecting) {
|
|
9
|
+
continue;
|
|
16
10
|
}
|
|
11
|
+
const img = entry.target;
|
|
12
|
+
const dataSrc = img.dataset.src;
|
|
13
|
+
if (dataSrc) {
|
|
14
|
+
img.setAttribute('src', dataSrc);
|
|
15
|
+
delete img.dataset.src;
|
|
16
|
+
}
|
|
17
|
+
this.observer.unobserve(img);
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
this.observer = new IntersectionObserver(this.handleIntersection);
|
|
@@ -12,14 +12,16 @@ export function createLazyLoadImagesPlugin(lazyLoadImages = false) {
|
|
|
12
12
|
}
|
|
13
13
|
return (tree) => {
|
|
14
14
|
visit(tree, 'element', (node) => {
|
|
15
|
-
if (node.tagName
|
|
16
|
-
|
|
17
|
-
node.properties.loading = 'lazy';
|
|
18
|
-
if (node.properties.src) {
|
|
19
|
-
node.properties['data-src'] = node.properties.src;
|
|
20
|
-
node.properties.src = undefined;
|
|
21
|
-
}
|
|
15
|
+
if (node.tagName !== 'img') {
|
|
16
|
+
return;
|
|
22
17
|
}
|
|
18
|
+
node.properties || (node.properties = {});
|
|
19
|
+
node.properties.loading = 'lazy';
|
|
20
|
+
if (!node.properties.src) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
node.properties['data-src'] = node.properties.src;
|
|
24
|
+
node.properties.src = undefined;
|
|
23
25
|
});
|
|
24
26
|
return tree;
|
|
25
27
|
};
|
|
@@ -11,17 +11,18 @@ export function createLinksPlugin() {
|
|
|
11
11
|
return (tree) => {
|
|
12
12
|
visit(tree, 'element', (node) => {
|
|
13
13
|
var _a, _b;
|
|
14
|
-
if (node.tagName
|
|
15
|
-
|
|
16
|
-
const title = (_b = node.properties) === null || _b === void 0 ? void 0 : _b.title;
|
|
17
|
-
if (!href) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const attributes = getLinkAttributes(href, title);
|
|
21
|
-
node.properties.target = attributes.target;
|
|
22
|
-
node.properties.rel = attributes.rel;
|
|
23
|
-
node.properties.referrerpolicy = attributes.referrerpolicy;
|
|
14
|
+
if (node.tagName !== 'a') {
|
|
15
|
+
return;
|
|
24
16
|
}
|
|
17
|
+
const href = (_a = node.properties) === null || _a === void 0 ? void 0 : _a.href;
|
|
18
|
+
if (!href) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const title = (_b = node.properties) === null || _b === void 0 ? void 0 : _b.title;
|
|
22
|
+
const attributes = getLinkAttributes(href, title);
|
|
23
|
+
node.properties.target = attributes.target;
|
|
24
|
+
node.properties.rel = attributes.rel;
|
|
25
|
+
node.properties.referrerpolicy = attributes.referrerpolicy;
|
|
25
26
|
});
|
|
26
27
|
return tree;
|
|
27
28
|
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { fromDom } from "hast-util-from-dom";
|
|
2
|
+
import { defaultHandlers } from "hast-util-to-mdast";
|
|
3
|
+
import { defaultHandlers as defaultMarkdownHandlers, } from "mdast-util-to-markdown";
|
|
4
|
+
import rehypeRemark from "rehype-remark";
|
|
5
|
+
import remarkGfm from "remark-gfm";
|
|
6
|
+
import remarkParse from "remark-parse";
|
|
7
|
+
import remarkStringify from "remark-stringify";
|
|
8
|
+
import { unified } from "unified";
|
|
9
|
+
/**
|
|
10
|
+
* Convert rendered markdown content back to markdown, replacing each
|
|
11
|
+
* whitelisted custom element with the markdown it describes itself as.
|
|
12
|
+
*
|
|
13
|
+
* Elements that do not implement {@link MarkdownDescribable} are
|
|
14
|
+
* converted like any unknown element: their light DOM children are kept,
|
|
15
|
+
* and an element without children disappears.
|
|
16
|
+
*
|
|
17
|
+
* @param container - The element holding the rendered content.
|
|
18
|
+
* @param whitelist - The custom elements allowed in the content.
|
|
19
|
+
* @returns The content as GitHub Flavored Markdown.
|
|
20
|
+
*/
|
|
21
|
+
export async function exportMarkdown(container, whitelist) {
|
|
22
|
+
const tagNames = new Set(whitelist
|
|
23
|
+
.map((definition) => definition.tagName)
|
|
24
|
+
.filter(isDescribableTag));
|
|
25
|
+
// The tree is captured before any description is awaited, so that
|
|
26
|
+
// content rendered in the meantime cannot end up in the export without
|
|
27
|
+
// its description.
|
|
28
|
+
const describableElements = new Map();
|
|
29
|
+
const tree = fromDom(container, {
|
|
30
|
+
afterTransform: (domNode, hastNode) => {
|
|
31
|
+
if (hastNode.type !== 'element') {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
restoreDeferredImage(hastNode);
|
|
35
|
+
hideFootnoteBackReference(hastNode);
|
|
36
|
+
if (domNode instanceof Element && tagNames.has(domNode.localName)) {
|
|
37
|
+
describableElements.set(hastNode, domNode);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
await describeElements(describableElements);
|
|
42
|
+
const handlers = {
|
|
43
|
+
sup: handleSup,
|
|
44
|
+
section: handleSection,
|
|
45
|
+
};
|
|
46
|
+
for (const tagName of tagNames) {
|
|
47
|
+
handlers[tagName] = handleCustomElement;
|
|
48
|
+
}
|
|
49
|
+
const processor = unified()
|
|
50
|
+
.use(rehypeRemark, { handlers })
|
|
51
|
+
.use(remarkGfm)
|
|
52
|
+
.use(remarkStringify, {
|
|
53
|
+
bullet: '-',
|
|
54
|
+
handlers: { break: handleBreak },
|
|
55
|
+
});
|
|
56
|
+
const mdast = await processor.run({
|
|
57
|
+
type: 'root',
|
|
58
|
+
children: tree.children,
|
|
59
|
+
});
|
|
60
|
+
return processor.stringify(mdast).trimEnd();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The description is kept on the node itself, since `rehype-remark`
|
|
64
|
+
* works on a clone of the tree. It also becomes the node's only child, so
|
|
65
|
+
* that whitespace minification treats the element as content and keeps
|
|
66
|
+
* the spaces around it. An element whose description fails is converted
|
|
67
|
+
* as if it did not describe itself.
|
|
68
|
+
* @param elements
|
|
69
|
+
*/
|
|
70
|
+
async function describeElements(elements) {
|
|
71
|
+
await Promise.all([...elements].map(async ([node, element]) => {
|
|
72
|
+
try {
|
|
73
|
+
const description = await element.toMarkdown();
|
|
74
|
+
node.properties.dataMarkdownDescription = description;
|
|
75
|
+
node.children = [{ type: 'text', value: description }];
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
console.error('Failed to describe element as markdown', error);
|
|
79
|
+
}
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
const handleCustomElement = (state, node) => {
|
|
83
|
+
const description = node.properties.dataMarkdownDescription;
|
|
84
|
+
if (typeof description === 'string') {
|
|
85
|
+
return parseMarkdown(description);
|
|
86
|
+
}
|
|
87
|
+
return state.all(node);
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Write hard line breaks as two trailing spaces rather than a backslash,
|
|
91
|
+
* since the export is also read as plain text, where the spaces are
|
|
92
|
+
* invisible.
|
|
93
|
+
* @param args
|
|
94
|
+
*/
|
|
95
|
+
const handleBreak = (...args) => {
|
|
96
|
+
const markdown = defaultMarkdownHandlers.break(...args);
|
|
97
|
+
return markdown === '\\\n' ? ' \n' : markdown;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Parse a description into mdast nodes. A description that is a single
|
|
101
|
+
* paragraph gives phrasing content, so that an element inside a
|
|
102
|
+
* paragraph or list item stays inline.
|
|
103
|
+
* @param markdown
|
|
104
|
+
*/
|
|
105
|
+
function parseMarkdown(markdown) {
|
|
106
|
+
const { children } = unified()
|
|
107
|
+
.use(remarkParse)
|
|
108
|
+
.use(remarkGfm)
|
|
109
|
+
.parse(markdown);
|
|
110
|
+
if (children.length === 1 && children[0].type === 'paragraph') {
|
|
111
|
+
return children[0].children;
|
|
112
|
+
}
|
|
113
|
+
return children;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* An image that has not been scrolled into view yet keeps its URL in
|
|
117
|
+
* `data-src`, until the lazy loading moves it to `src`.
|
|
118
|
+
* @param node
|
|
119
|
+
*/
|
|
120
|
+
function restoreDeferredImage(node) {
|
|
121
|
+
const deferredSrc = node.properties.dataSrc;
|
|
122
|
+
if (node.tagName === 'img' && !node.properties.src && deferredSrc) {
|
|
123
|
+
node.properties.src = deferredSrc;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The links from a footnote back to its references are recreated when the
|
|
128
|
+
* markdown is rendered again.
|
|
129
|
+
* @param node
|
|
130
|
+
*/
|
|
131
|
+
function hideFootnoteBackReference(node) {
|
|
132
|
+
if (node.tagName === 'a' &&
|
|
133
|
+
node.properties.dataFootnoteBackref !== undefined) {
|
|
134
|
+
node.properties.dataMdast = 'ignore';
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Footnotes are labelled with their rendered numbers. The ids only keep an
|
|
139
|
+
* encoded, lowercased form of the original labels, which cannot be turned
|
|
140
|
+
* back into them reliably. A reference shows its footnote's number, and
|
|
141
|
+
* the definitions are listed in the same order.
|
|
142
|
+
* @param state
|
|
143
|
+
* @param node
|
|
144
|
+
*/
|
|
145
|
+
const handleSup = (state, node) => {
|
|
146
|
+
const link = node.children.find((child) => isElement(child, 'a') &&
|
|
147
|
+
child.properties.dataFootnoteRef !== undefined);
|
|
148
|
+
if (!link) {
|
|
149
|
+
return defaultHandlers.sup(state, node);
|
|
150
|
+
}
|
|
151
|
+
const identifier = link.children
|
|
152
|
+
.map((child) => (child.type === 'text' ? child.value : ''))
|
|
153
|
+
.join('');
|
|
154
|
+
return { type: 'footnoteReference', identifier, label: identifier };
|
|
155
|
+
};
|
|
156
|
+
const handleSection = (state, node) => {
|
|
157
|
+
if (node.properties.dataFootnotes === undefined) {
|
|
158
|
+
return defaultHandlers.section(state, node);
|
|
159
|
+
}
|
|
160
|
+
const list = node.children.find((child) => isElement(child, 'ol'));
|
|
161
|
+
const items = list === null || list === void 0 ? void 0 : list.children.filter((child) => isElement(child, 'li'));
|
|
162
|
+
return (items !== null && items !== void 0 ? items : []).map((item, index) => {
|
|
163
|
+
const identifier = String(index + 1);
|
|
164
|
+
return {
|
|
165
|
+
type: 'footnoteDefinition',
|
|
166
|
+
identifier,
|
|
167
|
+
label: identifier,
|
|
168
|
+
children: state.toFlow(state.all(item)),
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
function isElement(node, tagName) {
|
|
173
|
+
return node.type === 'element' && node.tagName === tagName;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Whether the custom element registered for the tag implements
|
|
177
|
+
* {@link MarkdownDescribable}. Stencil defines a component's methods on
|
|
178
|
+
* the element's prototype when the tag is registered, before the
|
|
179
|
+
* component itself has loaded.
|
|
180
|
+
* @param tagName
|
|
181
|
+
*/
|
|
182
|
+
function isDescribableTag(tagName) {
|
|
183
|
+
var _a;
|
|
184
|
+
const prototype = (_a = customElements.get(tagName)) === null || _a === void 0 ? void 0 : _a.prototype;
|
|
185
|
+
return typeof (prototype === null || prototype === void 0 ? void 0 : prototype.toMarkdown) === 'function';
|
|
186
|
+
}
|
|
@@ -2,6 +2,7 @@ import { unified } from "unified";
|
|
|
2
2
|
import remarkParse from "remark-parse";
|
|
3
3
|
import remarkRehype from "remark-rehype";
|
|
4
4
|
import remarkGfm from "remark-gfm";
|
|
5
|
+
import remarkBreaks from "remark-breaks";
|
|
5
6
|
import rehypeParse from "rehype-parse";
|
|
6
7
|
import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
|
|
7
8
|
import rehypeStringify from "rehype-stringify";
|
|
@@ -27,12 +28,10 @@ import { createRemoveEmptyParagraphsPlugin } from "./remove-empty-paragraphs-plu
|
|
|
27
28
|
*/
|
|
28
29
|
export async function markdownToHTML(text, options) {
|
|
29
30
|
var _a;
|
|
30
|
-
if (options === null || options === void 0 ? void 0 : options.forceHardLineBreaks) {
|
|
31
|
-
text = text.replaceAll(/(?<!\\)([\n\r])/g, ' $1');
|
|
32
|
-
}
|
|
33
31
|
const file = await unified()
|
|
34
32
|
.use(remarkParse)
|
|
35
33
|
.use(remarkGfm)
|
|
34
|
+
.use((options === null || options === void 0 ? void 0 : options.forceHardLineBreaks) ? [remarkBreaks] : [])
|
|
36
35
|
.use(remarkRehype, { allowDangerousHtml: true })
|
|
37
36
|
.use(rehypeRaw)
|
|
38
37
|
.use(createLinksPlugin())
|
|
@@ -39,6 +39,7 @@ import { adaptColorContrast } from "../../util/adapt-color-contrast";
|
|
|
39
39
|
* @exampleComponent limel-example-markdown-custom-component-with-json-props
|
|
40
40
|
* @exampleComponent limel-example-markdown-remove-empty-paragraphs
|
|
41
41
|
* @exampleComponent limel-example-markdown-adapt-color-contrast
|
|
42
|
+
* @exampleComponent limel-example-markdown-to-markdown
|
|
42
43
|
* @exampleComponent limel-example-markdown-composite
|
|
43
44
|
*/
|
|
44
45
|
export class Markdown {
|
|
@@ -97,7 +98,31 @@ export class Markdown {
|
|
|
97
98
|
this.adaptColorContrast = false;
|
|
98
99
|
this.imageIntersectionObserver = null;
|
|
99
100
|
}
|
|
100
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Returns the content as markdown, with every whitelisted custom
|
|
103
|
+
* element replaced by the markdown it describes itself as.
|
|
104
|
+
*
|
|
105
|
+
* Use this to hand the content to a target that cannot render custom
|
|
106
|
+
* elements, such as the clipboard. An element describes itself by
|
|
107
|
+
* implementing `MarkdownDescribable`; elements that do not keep
|
|
108
|
+
* their child content, or are removed if they have none.
|
|
109
|
+
*
|
|
110
|
+
* The markdown is generated from the rendered content, so it may be
|
|
111
|
+
* formatted differently from `value`.
|
|
112
|
+
*
|
|
113
|
+
* @alpha
|
|
114
|
+
* @returns The content as markdown.
|
|
115
|
+
*/
|
|
116
|
+
async toMarkdown() {
|
|
117
|
+
await this.rendering;
|
|
118
|
+
const { exportMarkdown } = await import('./markdown-exporter');
|
|
119
|
+
return exportMarkdown(this.rootElement, this.cachedCombinedWhitelist);
|
|
120
|
+
}
|
|
121
|
+
textChanged() {
|
|
122
|
+
this.rendering = this.renderMarkdown();
|
|
123
|
+
return this.rendering;
|
|
124
|
+
}
|
|
125
|
+
async renderMarkdown() {
|
|
101
126
|
try {
|
|
102
127
|
this.cleanupImageIntersectionObserver();
|
|
103
128
|
// The whitelist merge and default import live here (not in
|
|
@@ -145,7 +170,7 @@ export class Markdown {
|
|
|
145
170
|
this.cleanupImageIntersectionObserver();
|
|
146
171
|
}
|
|
147
172
|
render() {
|
|
148
|
-
return (h(Host, { key: '
|
|
173
|
+
return (h(Host, { key: 'cb9496c27479dce2acf8005bff7c780190f923ba' }, h("div", { key: 'a48bd187c4b08db7d7b2e105fe4b1c92089d1a57', id: "markdown", ref: (el) => (this.rootElement = el) })));
|
|
149
174
|
}
|
|
150
175
|
setupImageIntersectionObserver() {
|
|
151
176
|
if (this.lazyLoadImages) {
|
|
@@ -153,10 +178,11 @@ export class Markdown {
|
|
|
153
178
|
}
|
|
154
179
|
}
|
|
155
180
|
cleanupImageIntersectionObserver() {
|
|
156
|
-
if (this.imageIntersectionObserver) {
|
|
157
|
-
|
|
158
|
-
this.imageIntersectionObserver = null;
|
|
181
|
+
if (!this.imageIntersectionObserver) {
|
|
182
|
+
return;
|
|
159
183
|
}
|
|
184
|
+
this.imageIntersectionObserver.disconnect();
|
|
185
|
+
this.imageIntersectionObserver = null;
|
|
160
186
|
}
|
|
161
187
|
static get is() { return "limel-markdown"; }
|
|
162
188
|
static get encapsulation() { return "shadow"; }
|
|
@@ -282,6 +308,33 @@ export class Markdown {
|
|
|
282
308
|
}
|
|
283
309
|
};
|
|
284
310
|
}
|
|
311
|
+
static get methods() {
|
|
312
|
+
return {
|
|
313
|
+
"toMarkdown": {
|
|
314
|
+
"complexType": {
|
|
315
|
+
"signature": "() => Promise<string>",
|
|
316
|
+
"parameters": [],
|
|
317
|
+
"references": {
|
|
318
|
+
"Promise": {
|
|
319
|
+
"location": "global",
|
|
320
|
+
"id": "global::Promise"
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"return": "Promise<string>"
|
|
324
|
+
},
|
|
325
|
+
"docs": {
|
|
326
|
+
"text": "Returns the content as markdown, with every whitelisted custom\nelement replaced by the markdown it describes itself as.\n\nUse this to hand the content to a target that cannot render custom\nelements, such as the clipboard. An element describes itself by\nimplementing `MarkdownDescribable`; elements that do not keep\ntheir child content, or are removed if they have none.\n\nThe markdown is generated from the rendered content, so it may be\nformatted differently from `value`.",
|
|
327
|
+
"tags": [{
|
|
328
|
+
"name": "alpha",
|
|
329
|
+
"text": undefined
|
|
330
|
+
}, {
|
|
331
|
+
"name": "returns",
|
|
332
|
+
"text": "The content as markdown."
|
|
333
|
+
}]
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
}
|
|
285
338
|
static get watchers() {
|
|
286
339
|
return [{
|
|
287
340
|
"propName": "value",
|
|
@@ -320,7 +373,7 @@ function mergeWhitelists(defaults, consumer) {
|
|
|
320
373
|
merged.set(def.tagName, new Set(def.attributes));
|
|
321
374
|
}
|
|
322
375
|
}
|
|
323
|
-
return [...merged
|
|
376
|
+
return [...merged].map(([tagName, attrs]) => ({
|
|
324
377
|
tagName,
|
|
325
378
|
attributes: [...attrs],
|
|
326
379
|
}));
|
|
@@ -9,7 +9,7 @@ export const createRemoveEmptyParagraphsPlugin = (enabled = false) => {
|
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
-
const NBSP_REGEX = /\
|
|
12
|
+
const NBSP_REGEX = /\u{A0}/gu;
|
|
13
13
|
const ZERO_WIDTH_HEX_CODES = ['200B', '200C', '200D', 'FEFF'];
|
|
14
14
|
const MEANINGFUL_VOID_ELEMENTS = new Set([
|
|
15
15
|
'audio',
|
|
@@ -78,10 +78,9 @@ const isNodeEffectivelyEmpty = (node) => {
|
|
|
78
78
|
if (isMeaningfulElement(tagName)) {
|
|
79
79
|
return false;
|
|
80
80
|
}
|
|
81
|
-
if (TREAT_AS_EMPTY_ELEMENTS.has(tagName)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (!Array.isArray(element.children) || element.children.length === 0) {
|
|
81
|
+
if (TREAT_AS_EMPTY_ELEMENTS.has(tagName) ||
|
|
82
|
+
!Array.isArray(element.children) ||
|
|
83
|
+
element.children.length === 0) {
|
|
85
84
|
return true;
|
|
86
85
|
}
|
|
87
86
|
return element.children.every((child) => isNodeEffectivelyEmpty(child));
|
|
@@ -40,10 +40,11 @@ export class MasonryLayout {
|
|
|
40
40
|
this.hasRendered = true;
|
|
41
41
|
}
|
|
42
42
|
connectedCallback() {
|
|
43
|
-
if (this.hasRendered) {
|
|
44
|
-
|
|
45
|
-
this.scheduleLayout();
|
|
43
|
+
if (!this.hasRendered) {
|
|
44
|
+
return;
|
|
46
45
|
}
|
|
46
|
+
this.setupObservers();
|
|
47
|
+
this.scheduleLayout();
|
|
47
48
|
}
|
|
48
49
|
disconnectedCallback() {
|
|
49
50
|
var _a, _b, _c;
|
|
@@ -58,7 +59,7 @@ export class MasonryLayout {
|
|
|
58
59
|
const style = {
|
|
59
60
|
height: `${this.containerHeight}rem`,
|
|
60
61
|
};
|
|
61
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: 'eac58da6cc41749eaaae8ca78d9940132c632fba', style: style, class: { 'is-laid-out': this.hasRendered } }, h("slot", { key: 'c551e446908efa397c665301f121a02c2efb068c' })));
|
|
62
63
|
}
|
|
63
64
|
setupObservers() {
|
|
64
65
|
this.resizeObserver = new ResizeObserver(() => {
|