ngwr 16.2.0 → 16.4.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/badge/styles/_tag.scss +73 -1
- package/calendar/styles/_index.scss +22 -0
- package/carousel/styles/_index.scss +53 -1
- package/cascader/styles/_rules.scss +7 -0
- package/color-picker/styles/_index.scss +21 -0
- package/date-picker/styles/_index.scss +19 -0
- package/dropdown/styles/_index.scss +13 -19
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert-testing.mjs +70 -0
- package/fesm2022/ngwr-alert-testing.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +17 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +3 -3
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +129 -11
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs-testing.mjs +83 -0
- package/fesm2022/ngwr-breadcrumbs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger-testing.mjs +45 -0
- package/fesm2022/ngwr-burger-testing.mjs.map +1 -0
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-testing.mjs +18 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +500 -73
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel-testing.mjs +24 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +73 -10
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +45 -37
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-chart-legend.mjs +26 -11
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +3 -3
- package/fesm2022/ngwr-charts-donut-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +3 -2
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +17 -7
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +5 -4
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker-testing.mjs +11 -1
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +153 -37
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +10 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare-testing.mjs +84 -0
- package/fesm2022/ngwr-compare-testing.mjs.map +1 -0
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +28 -13
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +30 -4
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +342 -69
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +3 -3
- package/fesm2022/ngwr-date.mjs +59 -8
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +18 -18
- package/fesm2022/ngwr-directives.mjs +15 -15
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +51 -29
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +11 -3
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +70 -99
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +4 -3
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +186 -33
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +34 -2
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +279 -16
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +30 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +664 -43
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +27 -8
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +27 -8
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +27 -8
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +27 -8
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +27 -8
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +27 -8
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +27 -8
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +27 -8
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +27 -8
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +27 -8
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +27 -8
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +27 -8
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +27 -8
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +27 -8
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +27 -8
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +27 -8
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +27 -8
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +27 -8
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +27 -8
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +27 -8
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +27 -8
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +27 -8
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +3 -3
- package/fesm2022/ngwr-input-number-testing.mjs +11 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +68 -7
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +23 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +24 -1
- package/fesm2022/ngwr-input-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +152 -36
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +15 -15
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +175 -13
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs +6 -3
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +31 -29
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm-testing.mjs +5 -2
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +44 -63
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +7 -1
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +58 -156
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +50 -9
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs +57 -0
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable-testing.mjs +113 -0
- package/fesm2022/ngwr-resizable-testing.mjs.map +1 -0
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form-testing.mjs +336 -0
- package/fesm2022/ngwr-schema-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-schema-form.mjs +416 -19
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select-testing.mjs +19 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +361 -84
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +176 -0
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider-testing.mjs +6 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +21 -3
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +29 -12
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +42 -11
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-testing.mjs +157 -3
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +1051 -74
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs-testing.mjs +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +15 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +11 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +128 -16
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +40 -19
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour-testing.mjs +13 -1
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +19 -15
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer-testing.mjs +6 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +24 -5
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +62 -2
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +978 -79
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +97 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +33 -22
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +156 -0
- package/graph/styles/_index.scss +87 -0
- package/i18n/ar.json +29 -8
- package/i18n/cs.json +29 -8
- package/i18n/de.json +29 -8
- package/i18n/en.json +29 -8
- package/i18n/es.json +29 -8
- package/i18n/fr.json +29 -8
- package/i18n/he.json +29 -8
- package/i18n/hi.json +29 -8
- package/i18n/id.json +29 -8
- package/i18n/it.json +29 -8
- package/i18n/ja.json +29 -8
- package/i18n/ko.json +29 -8
- package/i18n/nl.json +29 -8
- package/i18n/pl.json +29 -8
- package/i18n/pt.json +29 -8
- package/i18n/ru.json +29 -8
- package/i18n/sv.json +29 -8
- package/i18n/tr.json +29 -8
- package/i18n/uk.json +29 -8
- package/i18n/vi.json +29 -8
- package/i18n/zh-TW.json +29 -8
- package/i18n/zh.json +29 -8
- package/input/styles/_index.scss +68 -1
- package/input-otp/styles/_index.scss +14 -0
- package/llms-full.txt +53 -21
- package/llms.txt +57 -24
- package/overlay/styles/_arrow.scss +4 -4
- package/package.json +33 -1
- package/popconfirm/styles/_index.scss +3 -11
- package/progress/styles/_index.scss +32 -0
- package/schema-form/styles/_index.scss +78 -0
- package/schematics/collection.json +5 -0
- package/schematics/eject/index.js +158 -0
- package/schematics/eject/schema.js +8 -0
- package/schematics/eject/schema.json +24 -0
- package/schematics/eject/source.js +295 -0
- package/schematics/use/rule.js +2 -0
- package/schematics/use/symbol-map.json +5 -0
- package/select/styles/_index.scss +127 -22
- package/skills/ngwr/SKILL.md +31 -4
- package/skills/ngwr/references/catalog.md +9 -1
- package/slider/styles/_index.scss +22 -0
- package/table/styles/_index.scss +191 -3
- package/textarea/styles/_index.scss +80 -0
- package/theme/styles/_focus.scss +16 -1
- package/theme/styles/_motion.scss +5 -0
- package/transfer/styles/_index.scss +84 -0
- package/tree/styles/_index.scss +138 -5
- package/types/ngwr-alert-testing.d.ts +88 -0
- package/types/ngwr-badge.d.ts +72 -2
- package/types/ngwr-breadcrumbs-testing.d.ts +92 -0
- package/types/ngwr-burger-testing.d.ts +51 -0
- package/types/ngwr-calendar-testing.d.ts +18 -6
- package/types/ngwr-calendar.d.ts +272 -22
- package/types/ngwr-carousel-testing.d.ts +27 -6
- package/types/ngwr-carousel.d.ts +42 -6
- package/types/ngwr-cascader.d.ts +13 -6
- package/types/ngwr-charts-chart-legend.d.ts +9 -4
- package/types/ngwr-charts-line-chart-testing.d.ts +4 -1
- package/types/ngwr-charts-line-chart.d.ts +7 -4
- package/types/ngwr-color-picker-testing.d.ts +15 -4
- package/types/ngwr-color-picker.d.ts +76 -6
- package/types/ngwr-compare-testing.d.ts +72 -0
- package/types/ngwr-context-menu.d.ts +2 -0
- package/types/ngwr-date-picker-testing.d.ts +23 -8
- package/types/ngwr-date-picker.d.ts +100 -9
- package/types/ngwr-date.d.ts +71 -1
- package/types/ngwr-drawer.d.ts +9 -0
- package/types/ngwr-dropdown-testing.d.ts +20 -0
- package/types/ngwr-dropdown.d.ts +26 -6
- package/types/ngwr-event-calendar.d.ts +66 -8
- package/types/ngwr-file-upload-testing.d.ts +31 -2
- package/types/ngwr-file-upload.d.ts +156 -3
- package/types/ngwr-form.d.ts +47 -3
- package/types/ngwr-graph-testing.d.ts +36 -3
- package/types/ngwr-graph.d.ts +309 -13
- package/types/ngwr-input-number-testing.d.ts +10 -0
- package/types/ngwr-input-number.d.ts +30 -1
- package/types/ngwr-input-otp.d.ts +10 -0
- package/types/ngwr-input-testing.d.ts +30 -0
- package/types/ngwr-input.d.ts +54 -3
- package/types/ngwr-overlay.d.ts +84 -5
- package/types/ngwr-pipes.d.ts +2 -1
- package/types/ngwr-popconfirm-testing.d.ts +12 -3
- package/types/ngwr-popconfirm.d.ts +28 -3
- package/types/ngwr-popover-testing.d.ts +19 -2
- package/types/ngwr-popover.d.ts +22 -2
- package/types/ngwr-progress.d.ts +29 -1
- package/types/ngwr-pull-to-refresh-testing.d.ts +83 -0
- package/types/ngwr-resizable-testing.d.ts +116 -0
- package/types/ngwr-schema-form-testing.d.ts +260 -0
- package/types/ngwr-schema-form.d.ts +76 -6
- package/types/ngwr-select-testing.d.ts +20 -0
- package/types/ngwr-select.d.ts +149 -11
- package/types/ngwr-sidebar-testing.d.ts +176 -0
- package/types/ngwr-slider-testing.d.ts +3 -1
- package/types/ngwr-slider.d.ts +21 -1
- package/types/ngwr-sortable-list.d.ts +6 -0
- package/types/ngwr-stepper.d.ts +20 -11
- package/types/ngwr-table-testing.d.ts +122 -7
- package/types/ngwr-table.d.ts +572 -50
- package/types/ngwr-tabs-testing.d.ts +14 -17
- package/types/ngwr-tabs.d.ts +6 -0
- package/types/ngwr-textarea-testing.d.ts +10 -0
- package/types/ngwr-textarea.d.ts +48 -2
- package/types/ngwr-toast.d.ts +8 -1
- package/types/ngwr-tour-testing.d.ts +10 -0
- package/types/ngwr-tour.d.ts +11 -2
- package/types/ngwr-transfer-testing.d.ts +3 -0
- package/types/ngwr-transfer.d.ts +24 -1
- package/types/ngwr-tree-testing.d.ts +65 -1
- package/types/ngwr-tree.d.ts +335 -12
- package/types/ngwr-utils.d.ts +107 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +7 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-editor.mjs","names":["nextId","DOCUMENT"],"sources":["../../../projects/lib/editor/internal/json.ts","../../../projects/lib/editor/internal/safe-url.ts","../../../projects/lib/editor/internal/schema.ts","../../../projects/lib/editor/internal/codec.ts","../../../projects/lib/editor/internal/commands.ts","../../../projects/lib/editor/internal/icons.ts","../../../projects/lib/editor/internal/link-field.ts","../../../projects/lib/editor/internal/list-item-view.ts","../../../projects/lib/editor/toolbar.ts","../../../projects/lib/editor/editor.ts","../../../projects/lib/editor/editor.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Node, Schema } from 'prosemirror-model';\n\nimport type { WrEditorJson } from '../types';\n\n/**\n * How deep a JSON value may nest before it is refused unread.\n *\n * Not the editing limit — that is `MAX_NESTING`, counted in quotes and list\n * items. This one is the stack's: `Node.fromJSON` and `check()` both recurse,\n * and about three thousand nested blocks overflow them. A document the editor\n * itself can produce is nowhere near it (eleven levels of list is under forty\n * JSON levels), so anything past it was not written by an editor.\n */\nconst MAX_JSON_DEPTH = 256;\n\n/**\n * An untrusted JSON value as a checked document, or a thrown `RangeError`.\n *\n * Both steps are needed. `nodeFromJSON` refuses an unknown node or mark, an\n * empty text node and an attribute its validator rejects — the URL policy\n * among them — but does NOT check content expressions; `check()` does, and\n * re-runs the validators besides. The shape pass in front keeps a malformed or\n * hostile value from reaching either: a non-object, a `text` that is not a\n * string, or nesting past {@link MAX_JSON_DEPTH}.\n */\nfunction readJson(value: unknown, schema: Schema): Node {\n assertShape(value, 0);\n const doc = schema.nodeFromJSON(value);\n if (doc.type !== schema.topNodeType) throw new RangeError('<wr-editor>: a JSON value is a `doc` node');\n doc.check();\n return doc;\n}\n\nfunction assertShape(value: unknown, depth: number): asserts value is WrEditorJson {\n if (depth > MAX_JSON_DEPTH) throw new RangeError('<wr-editor>: the JSON value nests too deeply');\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new RangeError('<wr-editor>: every JSON node is an object');\n }\n const node = value as Record<string, unknown>;\n if (typeof node['type'] !== 'string') throw new RangeError('<wr-editor>: every JSON node has a string `type`');\n if (node['text'] !== undefined && typeof node['text'] !== 'string') {\n throw new RangeError('<wr-editor>: `text` is a string');\n }\n for (const key of ['attrs', 'marks', 'content'] as const) {\n const child = node[key];\n if (child === undefined) continue;\n if (key === 'attrs') {\n if (typeof child !== 'object' || child === null || Array.isArray(child)) {\n throw new RangeError('<wr-editor>: `attrs` is an object');\n }\n continue;\n }\n if (!Array.isArray(child)) throw new RangeError(`<wr-editor>: \\`${key}\\` is an array`);\n for (const item of child) assertShape(item, depth + 1);\n }\n}\n\nexport { readJson };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nconst SCHEME_RE = /^([a-z][a-z0-9+.-]*):/i;\nconst ALLOWED_SCHEMES = new Set(['http', 'https', 'mailto', 'tel', 'ftp']);\nconst DATA_IMAGE_RE = /^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[a-z0-9+/=]+$/i;\n\n/**\n * Whitespace and control characters only: a hyphen has no business being\n * stripped out of a host name. Written as escapes rather than literal bytes — a\n * raw NUL inside a regex literal makes the file binary to every text tool.\n * Stripping control characters is the entire point: a browser ignores them before\n * resolving the scheme, so a check that reads the raw string sees a relative path\n * and waves `java\\u0000script:` straight through.\n */\n// eslint-disable-next-line no-control-regex\nconst URL_IGNORED_RE = /[\\s\\u0000-\\u001f\\u007f]/g;\n\n/**\n * The character references that can spell a scheme once something decodes them:\n * every numeric one, and the named ones for the colon and for the whitespace a\n * browser strips (`:`, `	`, `
`). Matched without regard to\n * case and with the semicolon optional, which is wider than any HTML or markdown\n * renderer decodes — the net only ever catches a URL nobody writes.\n */\nconst SCHEME_REFERENCE_RE = /&(?:#x([0-9a-f]+)|#(\\d+)|(colon|tab|newline));?/gi;\n\nfunction decodeSchemeReferences(url: string): string {\n return url.replace(SCHEME_REFERENCE_RE, (_reference, hex?: string, decimal?: string, name?: string) => {\n if (name) return name.toLowerCase() === 'colon' ? ':' : '\\n';\n const code = hex ? Number.parseInt(hex, 16) : Number(decimal);\n return code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : '\\ufffd';\n });\n}\n\n/**\n * A URL safe to put in a link's `href` or an image's `src`, or `null` where the\n * editor refuses it — the one URL policy behind the link panel, a paste and a\n * bound value.\n *\n * A refusal is never rewritten into something else. Angular's answer to a\n * hostile URL is the string `unsafe:javascript:…` in a live anchor — a link that\n * looks real, is announced as a link, and does nothing — so a pasted link keeps\n * its text and loses the URL instead, the panel says the address cannot be used,\n * and a bound value holding one is refused whole.\n *\n * Whitespace and control characters are stripped before the scheme is read,\n * because `java\\nscript:` and `java script:` are the same URL to a browser and\n * different strings to a naive check. So are character references:\n * `javascript:` has no scheme to this check, and the editor's own drawing\n * never decodes it — but a stored value is read again by whatever renders it\n * next, and an HTML attribute or a markdown destination hands a browser\n * `javascript:`. The scheme is read from the decoded form; what comes back is\n * still the URL as written.\n */\nfunction safeUrl(raw: string, kind: 'link' | 'image'): string | null {\n const url = raw.trim();\n const bare = url.replace(URL_IGNORED_RE, '');\n const scheme = SCHEME_RE.exec(decodeSchemeReferences(bare).replace(URL_IGNORED_RE, ''));\n\n // No scheme at all: relative path, `#anchor`, `//host` — nothing executable.\n if (!scheme) return url;\n\n const name = scheme[1].toLowerCase();\n\n // `data:` is an image-only allowance, and only for raster types: an SVG can\n // carry script, and `data:text/html` is a same-origin document.\n if (name === 'data') return kind === 'image' && DATA_IMAGE_RE.test(bare) ? bare : null;\n\n return ALLOWED_SCHEMES.has(name) ? url : null;\n}\n\nexport { safeUrl };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type MarkSpec, type Node, type NodeSpec, Schema } from 'prosemirror-model';\n\nimport { safeUrl } from './safe-url';\n\n/**\n * How deep blockquotes and list items may nest through editing. Each quote and\n * each list item is one level.\n *\n * Some limit has to exist, because the editor must read back what it writes: a\n * bound value nesting past `MAX_JSON_DEPTH` is refused unread, so a Mod-] held\n * down long enough would otherwise store a document the next load refuses.\n * Eleven is deeper than any outline anyone writes and far inside that bound.\n */\nconst MAX_NESTING = 11;\n\n/** The `align` values a table cell may carry. */\nconst ALIGNS: ReadonlySet<unknown> = new Set([null, 'start', 'center', 'end']);\n\n/** The largest list start: nine digits, the most the `1. ` input rule reads. */\nconst MAX_ORDER = 999999999;\n\n/**\n * The URL policy as a schema rule.\n *\n * A paste asks it in `getAttrs`, where a refusal drops the link and keeps its\n * text. A bound value — plus every attribute ProseMirror validates since view\n * 1.42.3, clipboard slice context included — hits these validators, which THROW:\n * a value holding a refused URL is refused as a whole, the same as one holding\n * an unknown node.\n */\nfunction requireUrl(kind: 'link' | 'image') {\n return (value: unknown): void => {\n if (typeof value !== 'string' || safeUrl(value, kind) !== value) {\n throw new RangeError(`<wr-editor>: refused ${kind} URL`);\n }\n };\n}\n\nfunction nullableString(value: unknown): void {\n if (value !== null && typeof value !== 'string') throw new RangeError('<wr-editor>: expected a string or null');\n}\n\n/**\n * The attributes of an `<a>` a pasted document may keep: the href, and only when\n * the policy allows it. `false` drops the mark and keeps the text — which is why\n * this refuses rather than rewrites.\n */\nfunction linkAttrs(dom: HTMLElement): false | { href: string; title: string | null } {\n const href = safeUrl(dom.getAttribute('href') ?? '', 'link');\n return href ? { href, title: dom.getAttribute('title') } : false;\n}\n\nfunction imageAttrs(dom: HTMLElement): false | { src: string; alt: string; title: string | null } {\n const src = safeUrl(dom.getAttribute('src') ?? '', 'image');\n return src ? { src, alt: dom.getAttribute('alt') ?? '', title: dom.getAttribute('title') } : false;\n}\n\n/**\n * A list item's task state, from this schema's own `data-checked` or from the\n * `<input type=\"checkbox\">` GitHub-style renderers put first in the item.\n */\nfunction checkedOf(dom: HTMLElement): boolean | null {\n const data = dom.getAttribute('data-checked');\n if (data === 'true' || data === 'false') return data === 'true';\n for (let child = dom.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === 3 && !(child.textContent ?? '').trim()) continue;\n if (child.nodeName !== 'INPUT') return null;\n const input = child as HTMLInputElement;\n return (input.getAttribute('type') ?? '').toLowerCase() === 'checkbox' ? input.hasAttribute('checked') : null;\n }\n return null;\n}\n\nfunction alignOf(dom: HTMLElement): 'start' | 'center' | 'end' | null {\n // The first one that says anything: an element with no inline style reports\n // `''` for it, not null, so a nullish fallback would stop there.\n const raw = [dom.getAttribute('data-align'), dom.style?.textAlign, dom.getAttribute('align')].find(Boolean) ?? '';\n const word = raw.toLowerCase();\n if (word === 'center') return 'center';\n if (word === 'start' || word === 'left') return 'start';\n if (word === 'end' || word === 'right') return 'end';\n return null;\n}\n\n/**\n * A code block's language: the first word, lowercased, and nothing past 64\n * characters — or `null`. It becomes a class name and a data attribute, so the\n * one rule for it on every path in is that nothing can break out of a word.\n */\nfunction languageValue(raw: string | null): string | null {\n const word = (raw ?? '').trim().split(/\\s+/)[0].toLowerCase();\n return word && word.length <= 64 ? word : null;\n}\n\nfunction languageOf(dom: HTMLElement): string | null {\n const code = dom.querySelector('code');\n const named = dom.getAttribute('data-language') ?? code?.getAttribute('data-language');\n const fromClass = /(?:^|\\s)language-(\\S+)/.exec(code?.getAttribute('class') ?? '')?.[1];\n return languageValue(named ?? fromClass ?? null);\n}\n\nfunction orderOf(dom: HTMLElement): number {\n const start = Number.parseInt(dom.getAttribute('start') ?? '', 10);\n return Number.isFinite(start) ? Math.min(Math.max(start, 0), MAX_ORDER) : 1;\n}\n\nconst nodes: Record<string, NodeSpec> = {\n doc: { content: 'block+' },\n\n paragraph: {\n group: 'block',\n content: 'inline*',\n parseDOM: [{ tag: 'p' }],\n toDOM: () => ['p', 0],\n },\n\n heading: {\n group: 'block',\n content: 'inline*',\n defining: true,\n attrs: {\n level: {\n default: 1,\n // A FUNCTION, not `'number'`: the level becomes a tag name in `toDOM`,\n // and a type check alone accepts `{ level: 9 }`.\n validate: (value: unknown) => {\n if (value !== 1 && value !== 2 && value !== 3) throw new RangeError('<wr-editor>: heading level is 1–3');\n },\n },\n },\n // h4–h6 clamp to h3 rather than falling through to a paragraph, which would\n // lose the fact that the line was a heading at all.\n parseDOM: [\n { tag: 'h1', attrs: { level: 1 } },\n { tag: 'h2', attrs: { level: 2 } },\n { tag: 'h3', attrs: { level: 3 } },\n { tag: 'h4', attrs: { level: 3 } },\n { tag: 'h5', attrs: { level: 3 } },\n { tag: 'h6', attrs: { level: 3 } },\n ],\n toDOM: node => [`h${Math.min(Math.max(Number(node.attrs['level']) || 1, 1), 3)}`, 0],\n },\n\n blockquote: {\n group: 'block',\n content: 'block+',\n defining: true,\n parseDOM: [{ tag: 'blockquote' }],\n toDOM: () => ['blockquote', 0],\n },\n\n code_block: {\n group: 'block',\n content: 'text*',\n marks: '',\n code: true,\n defining: true,\n attrs: {\n language: {\n default: null,\n validate: (value: unknown) => {\n if (value !== null && (typeof value !== 'string' || languageValue(value) !== value)) {\n throw new RangeError('<wr-editor>: a code language is one lowercase word');\n }\n },\n },\n },\n parseDOM: [{ tag: 'pre', preserveWhitespace: 'full', getAttrs: dom => ({ language: languageOf(dom) }) }],\n toDOM: node => {\n const language = node.attrs['language'] as string | null;\n return ['pre', ['code', language ? { class: `language-${language}`, 'data-language': language } : {}, 0]];\n },\n },\n\n horizontal_rule: {\n group: 'block',\n parseDOM: [{ tag: 'hr' }],\n toDOM: () => ['hr'],\n },\n\n bullet_list: {\n group: 'block',\n content: 'list_item+',\n attrs: { tight: { default: true, validate: 'boolean' } },\n parseDOM: [{ tag: 'ul' }],\n toDOM: () => ['ul', 0],\n },\n\n ordered_list: {\n group: 'block',\n content: 'list_item+',\n attrs: {\n order: {\n default: 1,\n validate: (value: unknown) => {\n if (!Number.isInteger(value) || (value as number) < 0 || (value as number) > MAX_ORDER) {\n throw new RangeError('<wr-editor>: a list starts at a whole number');\n }\n },\n },\n tight: { default: true, validate: 'boolean' },\n },\n parseDOM: [{ tag: 'ol', getAttrs: dom => ({ order: orderOf(dom) }) }],\n toDOM: node => (node.attrs['order'] === 1 ? ['ol', 0] : ['ol', { start: String(node.attrs['order']) }, 0]),\n },\n\n list_item: {\n content: 'paragraph block*',\n defining: true,\n attrs: {\n checked: {\n default: null,\n validate: (value: unknown) => {\n if (value !== null && typeof value !== 'boolean') throw new RangeError('<wr-editor>: checked is a boolean');\n },\n },\n },\n parseDOM: [{ tag: 'li', getAttrs: dom => ({ checked: checkedOf(dom) }) }],\n toDOM: node => {\n const checked = node.attrs['checked'] as boolean | null;\n return checked === null ? ['li', 0] : ['li', { 'data-checked': String(checked) }, 0];\n },\n },\n\n table: {\n group: 'block',\n content: 'table_row+',\n isolating: true,\n parseDOM: [{ tag: 'table' }],\n toDOM: () => ['table', ['tbody', 0]],\n },\n\n table_row: {\n content: '(table_header | table_cell)+',\n parseDOM: [{ tag: 'tr' }],\n toDOM: () => ['tr', 0],\n },\n\n table_header: cell('th'),\n table_cell: cell('td'),\n\n text: { group: 'inline' },\n\n image: {\n group: 'inline',\n inline: true,\n draggable: true,\n attrs: {\n src: { validate: requireUrl('image') },\n alt: { default: '', validate: 'string' },\n title: { default: null, validate: nullableString },\n },\n parseDOM: [{ tag: 'img[src]', getAttrs: imageAttrs }],\n toDOM: node => {\n // Re-asked here: validators do not run on `type.create()`, so a node built\n // in code never passed through them.\n const src = safeUrl(String(node.attrs['src'] ?? ''), 'image');\n const title = node.attrs['title'] as string | null;\n return ['img', { src: src ?? '', alt: String(node.attrs['alt'] ?? ''), ...(title ? { title } : {}) }];\n },\n },\n\n hard_break: {\n group: 'inline',\n inline: true,\n selectable: false,\n linebreakReplacement: true,\n parseDOM: [{ tag: 'br' }],\n toDOM: () => ['br'],\n },\n};\n\nfunction cell(tag: 'th' | 'td'): NodeSpec {\n return {\n content: 'paragraph+',\n isolating: true,\n attrs: {\n align: {\n default: null,\n validate: (value: unknown) => {\n if (!ALIGNS.has(value)) throw new RangeError('<wr-editor>: align is start, center or end');\n },\n },\n },\n parseDOM: [{ tag, getAttrs: dom => ({ align: alignOf(dom) }) }],\n // The value is one of three words — checked by the validator, and again\n // here — so writing it into `style` cannot carry anything the input chose.\n toDOM: node => {\n const align = node.attrs['align'] as string | null;\n return ALIGNS.has(align) && align ? [tag, { style: `text-align: ${align}` }, 0] : [tag, 0];\n },\n };\n}\n\n/**\n * Marks in nesting order, outermost first — which is also how `toDOM` nests\n * them, on the surface and in the HTML a copy puts on the clipboard.\n */\nconst marks: Record<string, MarkSpec> = {\n link: {\n inclusive: false,\n attrs: {\n href: { validate: requireUrl('link') },\n title: { default: null, validate: nullableString },\n },\n parseDOM: [{ tag: 'a[href]', getAttrs: linkAttrs }],\n toDOM: mark => {\n const href = safeUrl(String(mark.attrs['href'] ?? ''), 'link');\n if (!href) return ['span', 0];\n const title = mark.attrs['title'] as string | null;\n return ['a', { href, ...(title ? { title } : {}), rel: 'noopener noreferrer nofollow' }, 0];\n },\n },\n strong: {\n parseDOM: [\n { tag: 'strong' },\n // Google Docs wraps a whole paste in `<b style=\"font-weight: normal\">`.\n { tag: 'b', getAttrs: dom => dom.style.fontWeight !== 'normal' && null },\n { style: 'font-weight=400', clearMark: mark => mark.type.name === 'strong' },\n { style: 'font-weight', getAttrs: value => /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null },\n ],\n toDOM: () => ['strong', 0],\n },\n em: {\n parseDOM: [\n { tag: 'i' },\n { tag: 'em' },\n { style: 'font-style=italic' },\n { style: 'font-style=normal', clearMark: mark => mark.type.name === 'em' },\n ],\n toDOM: () => ['em', 0],\n },\n underline: {\n parseDOM: [{ tag: 'u' }, { style: 'text-decoration=underline' }, { style: 'text-decoration-line=underline' }],\n toDOM: () => ['u', 0],\n },\n strike: {\n parseDOM: [\n { tag: 's' },\n { tag: 'del' },\n { tag: 'strike' },\n { style: 'text-decoration=line-through' },\n { style: 'text-decoration-line=line-through' },\n ],\n toDOM: () => ['s', 0],\n },\n code: {\n code: true,\n parseDOM: [{ tag: 'code' }],\n toDOM: () => ['code', 0],\n },\n};\n\nlet schema: Schema | null = null;\n\n/** The editor's schema, built on first use and shared after that. */\nfunction editorSchema(): Schema {\n return (schema ??= new Schema({ nodes, marks }));\n}\n\n/** How many blockquotes and list items deep the document's deepest block sits. */\nfunction nestingOf(doc: Node): number {\n let deepest = 0;\n const walk = (node: Node, depth: number): void => {\n node.forEach(child => {\n if (child.isTextblock || child.isLeaf) return;\n const next = child.type.name === 'blockquote' || child.type.name === 'list_item' ? depth + 1 : depth;\n if (next > deepest) deepest = next;\n walk(child, next);\n });\n };\n walk(doc, 0);\n return deepest;\n}\n\n/**\n * A document that is one empty textblock — the shape the placeholder is drawn\n * on. Which textblock is open: an empty heading shows the hint as well.\n *\n * Not the test for \"nothing written\"; that is {@link isBlankDoc}.\n */\nfunction isEmptyDoc(doc: Node): boolean {\n if (doc.childCount !== 1) return false;\n const only = doc.firstChild!;\n return only.isTextblock && only.childCount === 0;\n}\n\n/**\n * A document with nothing written in it: no text but whitespace, and no leaf\n * but line breaks. An image or a rule is content in its own right; structure\n * alone is not.\n *\n * Decided by content rather than by shape, because every one of these looks\n * empty: Enter on an empty editor (two empty paragraphs), a lone Shift-Enter, a\n * few spaces, and a list, a quote or a heading chosen on an empty editor. Written\n * as anything but `null`, `required()` passes over an editor with nothing in it.\n */\nfunction isBlankDoc(doc: Node): boolean {\n let written = false;\n doc.descendants(node => {\n if (node.isText ? /\\S/.test(node.text!) : node.isLeaf && node.type.name !== 'hard_break') written = true;\n return !written;\n });\n return !written;\n}\n\nexport { MAX_NESTING, editorSchema, nestingOf, isEmptyDoc, isBlankDoc };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Node, Schema } from 'prosemirror-model';\n\nimport type { WrEditorJson, WrEditorValue } from '../types';\n\nimport { readJson } from './json';\nimport { isBlankDoc } from './schema';\n\n/**\n * A bound value as a document in `schema`, or a thrown error naming why it was\n * refused. `null` and `undefined` are the empty document.\n *\n * Throwing is the whole contract: the caller keeps the document it already has,\n * which is the rule `wr-input-number` and `wr-date-picker` follow for input they\n * cannot read. Nothing here ever returns a \"repaired\" document to write back.\n */\nexport function readValue(value: WrEditorValue | undefined, schema: Schema): Node {\n if (value === null || value === undefined) return schema.topNodeType.createAndFill()!;\n // Named on its own, since it is the one likely mistake: a tree stored as a JSON\n // string and bound without parsing it, or an HTML or markdown string.\n if (typeof value === 'string') throw new RangeError('<wr-editor>: the value is a JSON tree, not a string');\n return readJson(value, schema);\n}\n\n/** The document as a value — `null` when nothing is written in it: see {@link isBlankDoc}. */\nexport function writeValue(doc: Node): WrEditorValue {\n return isBlankDoc(doc) ? null : (doc.toJSON() as WrEditorJson);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { baseKeymap, chainCommands, exitCode, setBlockType, toggleMark, wrapIn } from 'prosemirror-commands';\nimport { history, redo, undo } from 'prosemirror-history';\nimport { inputRules, textblockTypeInputRule, undoInputRule, wrappingInputRule } from 'prosemirror-inputrules';\nimport { keymap } from 'prosemirror-keymap';\nimport type { Mark, MarkType, NodeType, ResolvedPos, Schema } from 'prosemirror-model';\nimport { liftListItem, sinkListItem, splitListItem, wrapInList } from 'prosemirror-schema-list';\nimport { type Command, type EditorState, Plugin, TextSelection, type Transaction } from 'prosemirror-state';\n\nimport type { WrEditorTool } from '../types';\n\nimport { MAX_NESTING, nestingOf } from './schema';\n\n/** Every tool but the separator. */\ntype WrEditorCommandTool = Exclude<WrEditorTool, '|'>;\n\n/** A shortcut, always on the platform's primary modifier (⌘ on Apple, Ctrl elsewhere). */\ninterface WrEditorShortcut {\n readonly key: string;\n readonly shift?: boolean;\n readonly alt?: boolean;\n}\n\n/**\n * The keyboard half of each tool — the keymap below binds exactly these, so a\n * hint can never name a shortcut that does nothing.\n *\n * Where a convention exists it is followed: Google Docs for the block types\n * (Mod-Alt-0…3, Mod-Shift-7/8), and Tiptap / Notion for the three it does not\n * cover (Mod-Shift-S strikethrough, Mod-E inline code, Mod-Shift-B quote,\n * Mod-Alt-C code block). The horizontal rule has none. Tab is deliberately not\n * bound — indenting with it would be a keyboard trap (WCAG 2.1.2), so list items\n * move with Mod-] and Mod-[ — and neither is Escape, which `<wr-dialog>` needs.\n *\n * Where a layout types `[` and `]` with AltGr or Option (German, French, the\n * Nordic and Polish layouts), the bracket chords are also read with that Alt\n * held — see {@link bracketKeys} — since nothing else indents a list item. The\n * Mod-Alt chords are NOT widened the same way: on Windows, Ctrl+Alt is AltGr, and\n * on those layouts AltGr+0 types `}` and AltGr+C types `ć`. Taking the chord by\n * physical key would make those characters impossible to type in the editor, so\n * there the key types its character and the toolbar sets the block type.\n */\nconst SHORTCUTS: Readonly<Partial<Record<WrEditorCommandTool, WrEditorShortcut>>> = {\n bold: { key: 'B' },\n italic: { key: 'I' },\n underline: { key: 'U' },\n strike: { key: 'S', shift: true },\n code: { key: 'E' },\n paragraph: { key: '0', alt: true },\n heading1: { key: '1', alt: true },\n heading2: { key: '2', alt: true },\n heading3: { key: '3', alt: true },\n bulletList: { key: '8', shift: true },\n orderedList: { key: '7', shift: true },\n blockquote: { key: 'B', shift: true },\n codeBlock: { key: 'C', alt: true },\n link: { key: 'K' },\n undo: { key: 'Z' },\n redo: { key: 'Z', shift: true },\n};\n\n/**\n * The tools a click toggles — the ones that carry `aria-pressed`. Not `link`,\n * which opens a panel: a popup button that also claimed to be pressed would say\n * two contradictory things.\n */\nconst TOGGLES: ReadonlySet<WrEditorCommandTool> = new Set<WrEditorCommandTool>([\n 'bold',\n 'italic',\n 'underline',\n 'strike',\n 'code',\n 'paragraph',\n 'heading1',\n 'heading2',\n 'heading3',\n 'bulletList',\n 'orderedList',\n 'blockquote',\n 'codeBlock',\n]);\n\n// ---------------------------------------------------------------------------\n// State\n// ---------------------------------------------------------------------------\n\nfunction markActive(state: EditorState, type: MarkType): boolean {\n const { empty, from, to, $from } = state.selection;\n if (empty) return !!type.isInSet(state.storedMarks ?? $from.marks());\n return state.doc.rangeHasMark(from, to, type);\n}\n\n/**\n * Whether every textblock the selection touches is `type` — asked of the blocks\n * themselves rather than of `$from.parent`, which is the DOCUMENT under a\n * select-all.\n */\nfunction parentIs(state: EditorState, type: NodeType, attrs?: Record<string, unknown>): boolean {\n const { empty, from, to, $from } = state.selection;\n if (empty) return $from.parent.hasMarkup(type, attrs);\n let found = false;\n let all = true;\n state.doc.nodesBetween(from, to, node => {\n if (!node.isTextblock) return true;\n found = true;\n if (!node.hasMarkup(type, attrs)) all = false;\n return false;\n });\n return found && all;\n}\n\n/** The nearest list around the selection, with the position it starts at. */\nfunction nearestList(state: EditorState): { readonly type: NodeType; readonly pos: number } | null {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth--) {\n const node = $from.node(depth);\n if (node.type.name === 'bullet_list' || node.type.name === 'ordered_list') {\n return { type: node.type, pos: $from.before(depth) };\n }\n }\n return null;\n}\n\nfunction insideNode(state: EditorState, type: NodeType): boolean {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth--) if ($from.node(depth).type === type) return true;\n return false;\n}\n\n/** Whether a tool's state is \"on\" at the selection — what `aria-pressed` reports. */\nfunction toolActive(tool: WrEditorCommandTool, state: EditorState): boolean {\n const { marks, nodes } = state.schema;\n switch (tool) {\n case 'bold':\n return markActive(state, marks['strong']);\n case 'italic':\n return markActive(state, marks['em']);\n case 'underline':\n return markActive(state, marks['underline']);\n case 'strike':\n return markActive(state, marks['strike']);\n case 'code':\n return markActive(state, marks['code']);\n case 'link':\n return linkRange(state) !== null;\n case 'paragraph':\n return parentIs(state, nodes['paragraph']);\n case 'heading1':\n return parentIs(state, nodes['heading'], { level: 1 });\n case 'heading2':\n return parentIs(state, nodes['heading'], { level: 2 });\n case 'heading3':\n return parentIs(state, nodes['heading'], { level: 3 });\n case 'codeBlock':\n return parentIs(state, nodes['code_block']);\n case 'bulletList':\n return nearestList(state)?.type === nodes['bullet_list'];\n case 'orderedList':\n return nearestList(state)?.type === nodes['ordered_list'];\n case 'blockquote':\n return insideNode(state, nodes['blockquote']);\n default:\n return false;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Commands\n// ---------------------------------------------------------------------------\n\n/** What a tool does. */\nfunction toolCommand(tool: WrEditorCommandTool, schema: Schema): Command {\n const { marks, nodes } = schema;\n const heading = (level: 1 | 2 | 3): Command => toggleBlock(nodes['heading'], nodes['paragraph'], { level });\n\n switch (tool) {\n case 'bold':\n return toggleMark(marks['strong']);\n case 'italic':\n return toggleMark(marks['em']);\n case 'underline':\n return toggleMark(marks['underline']);\n case 'strike':\n return toggleMark(marks['strike']);\n case 'code':\n return toggleMark(marks['code']);\n // The link tool opens a panel; `setLink` is its command.\n case 'link':\n return toggleMark(marks['link'], { href: '#' });\n case 'paragraph':\n return setBlockType(nodes['paragraph']);\n case 'heading1':\n return heading(1);\n case 'heading2':\n return heading(2);\n case 'heading3':\n return heading(3);\n case 'codeBlock':\n return toggleBlock(nodes['code_block'], nodes['paragraph']);\n case 'bulletList':\n return toggleList(nodes['bullet_list'], nodes['list_item']);\n case 'orderedList':\n return toggleList(nodes['ordered_list'], nodes['list_item']);\n case 'blockquote':\n return toggleQuote(nodes['blockquote']);\n case 'horizontalRule':\n return insertRule(nodes['horizontal_rule']);\n case 'undo':\n return undo;\n case 'redo':\n return redo;\n }\n}\n\n/** A block type that switches back to a paragraph when it is already on. */\nfunction toggleBlock(type: NodeType, paragraph: NodeType, attrs?: Record<string, unknown>): Command {\n return (state, dispatch) =>\n parentIs(state, type, attrs)\n ? setBlockType(paragraph)(state, dispatch)\n : setBlockType(type, attrs)(state, dispatch);\n}\n\n/**\n * A list toggle: out of this kind of list, over to it from the other kind, or\n * into a new one.\n */\nfunction toggleList(type: NodeType, item: NodeType): Command {\n return (state, dispatch) => {\n const list = nearestList(state);\n if (!list) return wrapInList(type)(state, dispatch);\n if (list.type === type) return liftListItem(item)(state, dispatch);\n if (dispatch) {\n const tight = state.doc.nodeAt(list.pos)?.attrs['tight'] !== false;\n const attrs = type.name === 'ordered_list' ? { order: 1, tight } : { tight };\n dispatch(state.tr.setNodeMarkup(list.pos, type, attrs).scrollIntoView());\n }\n return true;\n };\n}\n\n/**\n * Into a quote, or out of the nearest one.\n *\n * Out is a hand-rolled lift rather than `prosemirror-commands`' `lift`, which\n * lifts out of whatever the selection's parent is — inside a quoted list that is\n * the list item, not the quote. The target depth is the quote's own parent; a\n * lift that does not fit there throws, and the throw is the \"cannot\".\n */\nfunction toggleQuote(quote: NodeType): Command {\n return (state, dispatch) => {\n const { $from, $to } = state.selection;\n const range = insideNode(state, quote) ? $from.blockRange($to, node => node.type === quote) : null;\n if (!range) return wrapIn(quote)(state, dispatch);\n try {\n const tr = state.tr.lift(range, range.depth - 1);\n if (dispatch) dispatch(tr.scrollIntoView());\n return true;\n } catch {\n return false;\n }\n };\n}\n\n/**\n * A horizontal rule at the selection, where one fits without leaving an\n * isolating node — a table cell holds paragraphs only, and splitting the table\n * around a rule is not what anyone clicking the button meant.\n */\nfunction insertRule(rule: NodeType): Command {\n return (state, dispatch) => {\n const { $from } = state.selection;\n let fits = false;\n for (let depth = $from.depth; depth >= 0; depth--) {\n const node = $from.node(depth);\n const index = $from.index(depth);\n if (node.canReplaceWith(index, index, rule)) {\n fits = true;\n break;\n }\n if (node.type.spec.isolating) break;\n }\n if (!fits) return false;\n if (dispatch) dispatch(state.tr.replaceSelectionWith(rule.create()).scrollIntoView());\n return true;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Tables\n// ---------------------------------------------------------------------------\n\n/** The table around the selection, as a depth of `$from`, or `-1`. */\nfunction tableDepth(state: EditorState): number {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth--) if ($from.node(depth).type.name === 'table') return depth;\n return -1;\n}\n\n/**\n * An empty paragraph beside the table at `depth`, with the caret in it — the one\n * way to a line the keyboard cannot otherwise reach. There is no gap cursor here,\n * and a cell holds paragraphs, so Enter only ever splits inside it.\n */\nfunction paragraphBeside(\n state: EditorState,\n depth: number,\n side: 'before' | 'after',\n dispatch?: (tr: Transaction) => void\n): boolean {\n const { $from } = state.selection;\n const paragraph = state.schema.nodes['paragraph'];\n const parent = $from.node(depth - 1);\n const index = $from.index(depth - 1) + (side === 'after' ? 1 : 0);\n if (!parent.canReplaceWith(index, index, paragraph)) return false;\n if (dispatch) {\n const pos = side === 'after' ? $from.after(depth) : $from.before(depth);\n const tr = state.tr.insert(pos, paragraph.create());\n dispatch(tr.setSelection(TextSelection.create(tr.doc, pos + 1)).scrollIntoView());\n }\n return true;\n}\n\n/** Mod-Enter in a table: out of it, onto a new line below — what `exitCode` does for a code block. */\nconst exitTable: Command = (state, dispatch) => {\n const depth = tableDepth(state);\n return depth > 0 && paragraphBeside(state, depth, 'after', dispatch);\n};\n\n/**\n * The arrow key off the edge of a table nothing can be reached past: ArrowDown on\n * the last line of its last row with no text anywhere after it, ArrowUp on the\n * first line of its first row with none before. Anywhere else the key moves the\n * caret as it always does. Up and down only — left and right swap ends under\n * `dir=\"rtl\"`, and the vertical pair means the same thing in both directions.\n */\nfunction leaveTable(side: 'before' | 'after'): Command {\n return (state, dispatch, view) => {\n if (view && !view.editable) return false;\n const depth = tableDepth(state);\n const { $from, empty } = state.selection;\n if (depth < 0 || !empty) return false;\n // table > row > cell > paragraph: the row's place in the table, and the\n // paragraph's in its cell.\n const table = $from.node(depth);\n const cell = $from.node(depth + 2);\n const row = $from.index(depth);\n const block = $from.index(depth + 2);\n const edge =\n side === 'after' ? row === table.childCount - 1 && block === cell.childCount - 1 : row === 0 && block === 0;\n if (!edge) return false;\n const onEdgeLine = view\n ? view.endOfTextblock(side === 'after' ? 'down' : 'up')\n : $from.parentOffset === (side === 'after' ? $from.parent.content.size : 0);\n if (!onEdgeLine) return false;\n const outside = state.doc.resolve(side === 'after' ? $from.after(depth) : $from.before(depth));\n if (TextSelection.findFrom(outside, side === 'after' ? 1 : -1, true)) return false;\n return paragraphBeside(state, depth, side, dispatch);\n };\n}\n\nfunction insertHardBreak(state: EditorState, dispatch?: (tr: Transaction) => void): boolean {\n const type = state.schema.nodes['hard_break'];\n const { $from } = state.selection;\n if (!$from.parent.canReplaceWith($from.index(), $from.index(), type)) return false;\n if (dispatch) dispatch(state.tr.replaceSelectionWith(type.create()).scrollIntoView());\n return true;\n}\n\n// ---------------------------------------------------------------------------\n// Links\n// ---------------------------------------------------------------------------\n\n/**\n * The run of text carrying one link around the selection — the whole link, when\n * the caret merely sits in it — or `null` when there is none.\n */\nfunction linkRange(state: EditorState): { readonly from: number; readonly to: number; readonly mark: Mark } | null {\n const type = state.schema.marks['link'];\n const { empty, from, to, $from } = state.selection;\n if (!empty) {\n let found: Mark | null = null;\n state.doc.nodesBetween(from, to, node => {\n found ??= type.isInSet(node.marks) ?? null;\n });\n return found ? { from, to, mark: found } : null;\n }\n return markAround($from, type);\n}\n\nfunction markAround($pos: ResolvedPos, type: MarkType): { from: number; to: number; mark: Mark } | null {\n const parent = $pos.parent;\n const start = $pos.start();\n const offsets: number[] = [];\n parent.forEach((_child, offset) => offsets.push(offset));\n\n // The child the caret is in — or, at a boundary, the one before it and then\n // the one after, since a non-inclusive mark does not report itself at its end.\n const index = $pos.index();\n const candidates = ($pos.textOffset > 0 ? [index] : [index - 1, index]).filter(i => i >= 0 && i < parent.childCount);\n for (const at of candidates) {\n const mark = type.isInSet(parent.child(at).marks);\n if (!mark) continue;\n let first = at;\n let last = at;\n while (first > 0 && mark.isInSet(parent.child(first - 1).marks)) first--;\n while (last < parent.childCount - 1 && mark.isInSet(parent.child(last + 1).marks)) last++;\n return { from: start + offsets[first], to: start + offsets[last] + parent.child(last).nodeSize, mark };\n }\n return null;\n}\n\n/**\n * Link the selection to `href` — replacing the link it sits in when the caret\n * is inside one, and inserting the address as its own text when nothing is\n * selected at all. `href` has already passed the URL policy.\n */\nfunction setLink(href: string): Command {\n return (state, dispatch) => {\n const type = state.schema.marks['link'];\n const { empty, from, to } = state.selection;\n const existing = linkRange(state);\n const title = (existing?.mark.attrs['title'] as string | null | undefined) ?? null;\n const mark = type.create({ href, title });\n if (!toggleMark(type, { href })(state)) return false;\n if (!dispatch) return true;\n\n const tr = state.tr;\n if (!empty) tr.removeMark(from, to, type).addMark(from, to, mark);\n else if (existing) tr.removeMark(existing.from, existing.to, type).addMark(existing.from, existing.to, mark);\n else tr.insertText(href, from).addMark(from, from + href.length, mark);\n dispatch(tr.scrollIntoView());\n return true;\n };\n}\n\n/** Remove the link the selection is in or covers. */\nconst removeLink: Command = (state, dispatch) => {\n const range = linkRange(state);\n if (!range) return false;\n if (dispatch) dispatch(state.tr.removeMark(range.from, range.to, state.schema.marks['link']).scrollIntoView());\n return true;\n};\n\n// ---------------------------------------------------------------------------\n// Plugins\n// ---------------------------------------------------------------------------\n\n/**\n * The editor's plugin stack, in precedence order: its own keys, history keys,\n * ProseMirror's base keymap, then history and the markdown-style input rules.\n *\n * `canEdit` is asked for every document-changing transaction, because\n * `view.dispatch()` does not consult `editable` — a toolbar click or a plugin\n * would otherwise change a read-only document. Outside writes never pass here:\n * they replace the state wholesale.\n *\n * The input rules are the block shortcuts only. The typographic ones (smart\n * quotes, the em dash, the ellipsis) are left out on purpose: in a form control\n * they silently rewrite what someone typed into a name, a code or a reference.\n */\nfunction editorPlugins(\n schema: Schema,\n options: { readonly apple: boolean; readonly canEdit: () => boolean }\n): Plugin[] {\n const { nodes } = schema;\n const keys: Record<string, Command> = {};\n const bind = (combo: string, command: Command): void => {\n keys[combo] = command;\n // `event.key` is upper case under Shift or Caps Lock, and ProseMirror\n // matches on it; bound twice, the way `prosemirror-example-setup` does.\n const last = combo.slice(combo.lastIndexOf('-') + 1);\n if (/^[a-z]$/.test(last)) keys[combo.slice(0, -1) + last.toUpperCase()] = command;\n };\n\n for (const [tool, shortcut] of Object.entries(SHORTCUTS) as [WrEditorCommandTool, WrEditorShortcut][]) {\n if (tool === 'link' || tool === 'undo' || tool === 'redo') continue;\n bind(comboOf(shortcut), toolCommand(tool, schema));\n }\n bind('Mod-z', undo);\n bind('Mod-Shift-z', redo);\n if (!options.apple) bind('Mod-y', redo);\n keys['Shift-Enter'] = chainCommands(exitCode, insertHardBreak);\n keys['Mod-Enter'] = chainCommands(exitCode, exitTable);\n keys['Enter'] = splitListItem(nodes['list_item']);\n keys['Mod-['] = liftListItem(nodes['list_item']);\n keys['Mod-]'] = sinkListItem(nodes['list_item']);\n keys['ArrowDown'] = leaveTable('after');\n keys['ArrowUp'] = leaveTable('before');\n keys['Backspace'] = undoInputRule;\n\n return [\n new Plugin({\n filterTransaction: (tr, state) => {\n if (!tr.docChanged) return true;\n if (!options.canEdit()) return false;\n // `MAX_NESTING` is the deepest an edit may take a document. One that\n // already nests deeper (a bound value) is kept as it is; what is refused\n // is an edit that makes it deeper still.\n const depth = nestingOf(tr.doc);\n return depth <= MAX_NESTING || depth <= nestingOf(state.doc);\n },\n }),\n bracketKeys(nodes['list_item'], options.apple),\n keymap(keys),\n keymap(baseKeymap),\n history(),\n inputRules({\n rules: [\n textblockTypeInputRule(/^(#{1,3})\\s$/, nodes['heading'], match => ({ level: match[1].length })),\n wrappingInputRule(/^\\s*>\\s$/, nodes['blockquote']),\n wrappingInputRule(/^\\s*([-+*])\\s$/, nodes['bullet_list']),\n wrappingInputRule(\n /^(\\d{1,9})\\.\\s$/,\n nodes['ordered_list'],\n match => ({ order: Number(match[1]) }),\n (match, node) => node.childCount + (node.attrs['order'] as number) === Number(match[1])\n ),\n textblockTypeInputRule(/^```$/, nodes['code_block']),\n ],\n }),\n ];\n}\n\n/**\n * Mod-] and Mod-[ as they are TYPED on a layout that needs AltGr or Option for a\n * bracket: Windows German reports AltGr+8 as Ctrl+Alt with `key` `[`, macOS\n * German reports Option+5 under ⌘ as ⌘+Alt with `key` `[`. The keymap matches on\n * the full modifier set, so neither reaches `Mod-[`, and indenting a list item has\n * no other path — Tab is not bound and the toolbar has no indent tool.\n *\n * Matched on the character, never on `event.code`: the physical key at `]` is `+`\n * on a German keyboard, and Ctrl and `+` is the browser's zoom.\n */\nfunction bracketKeys(item: NodeType, apple: boolean): Plugin {\n const lift = liftListItem(item);\n const sink = sinkListItem(item);\n return new Plugin({\n props: {\n handleKeyDown: (view, event) => {\n if (!event.altKey || event.shiftKey || (event.key !== '[' && event.key !== ']')) return false;\n const mod = apple ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;\n return mod && (event.key === ']' ? sink : lift)(view.state, view.dispatch);\n },\n },\n });\n}\n\n/** A shortcut in ProseMirror's key-name syntax. */\nfunction comboOf(shortcut: WrEditorShortcut): string {\n return `Mod-${shortcut.alt ? 'Alt-' : ''}${shortcut.shift ? 'Shift-' : ''}${shortcut.key.toLowerCase()}`;\n}\n\nexport {\n SHORTCUTS,\n TOGGLES,\n toolActive,\n toolCommand,\n linkRange,\n setLink,\n removeLink,\n exitTable,\n leaveTable,\n editorPlugins,\n comboOf,\n};\nexport type { WrEditorCommandTool, WrEditorShortcut };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrEditorCommandTool } from './commands';\n\n/**\n * Toolbar glyphs as path data, drawn inline so the editor needs no\n * `provideWrIcons()` — the same reason `<wr-textarea>` inlines its grip.\n *\n * Lucide's (ISC), on its 24-unit grid with a 2-unit stroke; `line` elements are\n * rewritten as the equivalent paths so one `<path>` loop draws every icon.\n */\nexport const TOOL_ICONS: Readonly<Record<WrEditorCommandTool, readonly string[]>> = {\n bold: ['M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8'],\n italic: ['M19 4h-9', 'M14 20H5', 'M15 4 9 20'],\n underline: ['M6 4v6a6 6 0 0 0 12 0V4', 'M4 20h16'],\n strike: ['M16 4H9a3 3 0 0 0-2.83 4', 'M14 12a4 4 0 0 1 0 8H6', 'M4 12h16'],\n code: ['m16 18 6-6-6-6', 'm8 6-6 6 6 6'],\n paragraph: ['M13 4v16', 'M17 4v16', 'M19 4H9.5a4.5 4.5 0 0 0 0 9H13'],\n heading1: ['M4 12h8', 'M4 18V6', 'M12 18V6', 'm17 12 3-2v8'],\n heading2: ['M4 12h8', 'M4 18V6', 'M12 18V6', 'M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1'],\n heading3: [\n 'M4 12h8',\n 'M4 18V6',\n 'M12 18V6',\n 'M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2',\n 'M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2',\n ],\n bulletList: ['M3 5h.01', 'M3 12h.01', 'M3 19h.01', 'M8 5h13', 'M8 12h13', 'M8 19h13'],\n orderedList: [\n 'M11 5h10',\n 'M11 12h10',\n 'M11 19h10',\n 'M4 4h1v5',\n 'M4 9h2',\n 'M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02',\n ],\n blockquote: ['M17 5H3', 'M21 12H8', 'M21 19H8', 'M3 12v7'],\n codeBlock: [\n 'm10 9-3 3 3 3',\n 'm14 15 3-3-3-3',\n 'M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z',\n ],\n link: [\n 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71',\n 'M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71',\n ],\n horizontalRule: ['M5 12h14'],\n undo: ['M9 14 4 9l5-5', 'M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11'],\n redo: ['m15 14 5-5-5-5', 'M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13'],\n};\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { computed, signal } from '@angular/core';\n\nimport type { WrFormFieldContext } from 'ngwr/form';\n\nlet nextId = 0;\n\n/**\n * The field the link panel's URL input belongs to — provided as `WR_FORM_FIELD`\n * for the editor's whole subtree.\n *\n * It does two jobs at once. It is the SHIELD every composite control needs: the\n * editor is the control a `<wr-form-field>` wraps, and without a nearer provider\n * the `[wrInput]` in its link panel would adopt the outer field's id, take over\n * its label and announce its error as its own. And it is the input's own field:\n * `[wrInput]` binds `id`, `aria-invalid` and `aria-describedby` from whatever\n * field it finds, so answering here is how a refused URL reaches a screen reader\n * without binding attributes the directive already owns.\n *\n * @internal\n */\nexport class WrEditorLinkField implements WrFormFieldContext {\n private readonly id = `wr-editor-link-${nextId++}`;\n\n /** The URL just submitted was refused by the link policy. */\n readonly invalid = signal(false);\n\n readonly controlId = signal(`${this.id}-url`).asReadonly();\n readonly errorId = `${this.id}-error`;\n readonly panelId = `${this.id}-panel`;\n\n readonly errorKeys = computed<readonly string[]>(() => (this.invalid() ? ['url'] : []));\n readonly describedBy = computed(() => (this.invalid() ? this.errorId : null));\n readonly labelId = signal<string | null>(null).asReadonly();\n\n adoptControlId(): void {\n // The panel's input never carries an id of its own.\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Node } from 'prosemirror-model';\nimport type { NodeView, NodeViewConstructor, ViewMutationRecord } from 'prosemirror-view';\n\n/** The words a task item is read with — `editor.taskDone` / `editor.taskTodo`. */\ninterface WrTaskLabels {\n readonly done: string;\n readonly todo: string;\n}\n\n/**\n * List items as the editor draws them, which differs from the schema's `toDOM` —\n * what a copy puts on the clipboard — only for a TASK item.\n *\n * A task item's box is presentational, with its state as text beside it — the\n * same drawing as the read-only rendering. A real `<input type=\"checkbox\">` would\n * be an unlabelled form control inside the text, and making it operable would\n * promise an interaction v1 does not have. The box and the words sit outside the\n * editable content, so ProseMirror neither edits nor serializes them; the words\n * come from the catalog, which is why this is a node view the component builds\n * rather than a schema `toDOM` (the schema is shared and has no catalog).\n */\nfunction listItemView(labels: WrTaskLabels): NodeViewConstructor {\n return (node, view) => new WrListItemView(node, view.dom.ownerDocument, labels);\n}\n\nclass WrListItemView implements NodeView {\n readonly dom: HTMLElement;\n readonly contentDOM: HTMLElement;\n private node: Node;\n\n constructor(node: Node, document: Document, labels: WrTaskLabels) {\n this.node = node;\n this.dom = document.createElement('li');\n const checked = node.attrs['checked'] as boolean | null;\n if (checked === null) {\n this.contentDOM = this.dom;\n return;\n }\n\n this.dom.className = 'wr-editor__item wr-editor__item--task';\n this.dom.setAttribute('data-checked', String(checked));\n const box = document.createElement('span');\n box.className = checked ? 'wr-editor__task wr-editor__task--checked' : 'wr-editor__task';\n box.contentEditable = 'false';\n box.setAttribute('aria-hidden', 'true');\n const state = document.createElement('span');\n state.className = 'wr-editor__sr-only';\n state.contentEditable = 'false';\n state.textContent = checked ? labels.done : labels.todo;\n this.contentDOM = document.createElement('div');\n this.contentDOM.className = 'wr-editor__task-body';\n this.dom.append(box, state, this.contentDOM);\n }\n\n update(node: Node): boolean {\n // A task item becoming a plain one (or the reverse, or toggled) is drawn\n // again from scratch; there is no in-place way to add or drop the box.\n if (node.type !== this.node.type || node.attrs['checked'] !== this.node.attrs['checked']) return false;\n this.node = node;\n return true;\n }\n\n ignoreMutation(mutation: ViewMutationRecord): boolean {\n if (mutation.type === 'selection' || this.contentDOM === this.dom) return false;\n return !this.contentDOM.contains(mutation.target);\n }\n}\n\nexport { listItemView };\nexport type { WrTaskLabels };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrEditorTool } from './types';\n\n/**\n * The toolbar `<wr-editor>` draws when `toolbar` is not bound — every tool, in\n * five groups. Exported so a toolbar can be built from it rather than retyped:\n *\n * ```ts\n * readonly tools = WR_EDITOR_TOOLBAR.filter(tool => tool !== 'code');\n * ```\n */\nexport const WR_EDITOR_TOOLBAR: readonly WrEditorTool[] = [\n 'bold',\n 'italic',\n 'underline',\n 'strike',\n 'code',\n '|',\n 'paragraph',\n 'heading1',\n 'heading2',\n 'heading3',\n '|',\n 'bulletList',\n 'orderedList',\n 'blockquote',\n 'codeBlock',\n '|',\n 'link',\n 'horizontalRule',\n '|',\n 'undo',\n 'redo',\n];\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n type Signal,\n ViewEncapsulation,\n afterNextRender,\n afterRenderEffect,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n model,\n output,\n signal,\n untracked,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrInput } from 'ngwr/input';\nimport { WrPlatform } from 'ngwr/platform';\nimport { WrPopover } from 'ngwr/popover';\nimport { wrIsComposing, wrCheckStyles } from 'ngwr/utils';\nimport type { Node } from 'prosemirror-model';\nimport { EditorState, type Transaction } from 'prosemirror-state';\nimport { Decoration, DecorationSet, EditorView } from 'prosemirror-view';\n\nimport { readValue, writeValue } from './internal/codec';\nimport {\n SHORTCUTS,\n TOGGLES,\n type WrEditorCommandTool,\n editorPlugins,\n linkRange,\n removeLink,\n setLink,\n toolActive,\n toolCommand,\n} from './internal/commands';\nimport { TOOL_ICONS } from './internal/icons';\nimport { WrEditorLinkField } from './internal/link-field';\nimport { listItemView } from './internal/list-item-view';\nimport { safeUrl } from './internal/safe-url';\nimport { editorSchema, isEmptyDoc } from './internal/schema';\nimport { WR_EDITOR_TOOLBAR } from './toolbar';\nimport type { WrEditorJson, WrEditorMarkJson, WrEditorTool, WrEditorValue } from './types';\n\nlet nextId = 0;\n\nfunction warn(message: string): void {\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(`[NGWR] <wr-editor>: ${message}`);\n}\n\n/** One toolbar button's state at the current selection. */\ninterface WrToolState {\n readonly tool: WrEditorCommandTool;\n readonly active: boolean;\n readonly available: boolean;\n}\n\n/**\n * Rich-text editor on ProseMirror, with a toolbar, a link panel, keyboard\n * shortcuts and markdown-style block shortcuts (`# `, `> `, `- `, `1. `,\n * ` ``` `).\n *\n * A signal-forms native control: it implements `FormValueControl<WrEditorValue>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone.\n *\n * The value is the document as a {@link WrEditorJson} tree, `null` when nothing\n * is written. Whatever arrives is treated as untrusted and checked against the\n * editor's schema — every node, mark and attribute, every link and image URL —\n * and is read whole or not at all. A value the editor cannot read is refused:\n * the document it already shows is kept, a warning names the reason in dev\n * mode, and nothing is written back. Until a value it CAN read arrives the\n * editor is read-only and carries `wr-editor--refused`: the model still holds the\n * refused value, and an edit would write the document on screen over it.\n *\n * A paste is the other way content arrives, and it is not a value: ProseMirror\n * parses the clipboard's HTML through the schema's own rules, so whatever the\n * schema does not name is dropped, a link with a refused URL keeps its text and\n * loses the URL, and an image with one is left out.\n *\n * **`readonly` never mounts ProseMirror.** The document is drawn as ordinary\n * Angular markup instead — the same rendering the server prerenders — so a page\n * showing thirty saved comments boots no editor at all, and the headings, lists\n * and tables of what it shows stay in the accessibility tree rather than being\n * swallowed by a textbox, every descendant of which is presentational. It is\n * lazy, not permanent: the first time `readonly` is lifted the editor mounts,\n * and from there behaves exactly as one that never was read-only. Setting it\n * again keeps the mounted view — throwing a live session's undo history away to\n * save one view would cost more than the view.\n *\n * Headings stop at three levels: a pasted h4–h6 becomes an h3 rather than a\n * paragraph, and a value holding one is refused.\n *\n * ProseMirror is an OPTIONAL peer dependency: only an app that imports\n * `ngwr/editor` installs `prosemirror-model`, `-state`, `-view`, `-commands`,\n * `-keymap`, `-history`, `-schema-list` and `-inputrules`.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-editor placeholder=\"Describe the change\" [formField]=\"form.body\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-editor [(value)]=\"doc\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/editor\n */\n@Component({\n selector: 'wr-editor',\n templateUrl: './editor.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-editor',\n '[class]': 'classes()',\n '(focusout)': 'onFocusOut($event)',\n },\n // The editor is the control a `<wr-form-field>` wraps; the `[wrInput]` in its\n // link panel is a part. See `WrEditorLinkField` — the provider is both the\n // shield and that input's own field, which is why `fieldAria` below reads the\n // real field with `skipSelf`.\n providers: [\n { provide: WrEditorLinkField, useFactory: () => new WrEditorLinkField() },\n { provide: WR_FORM_FIELD, useExisting: WrEditorLinkField },\n ],\n imports: [NgTemplateOutlet, WrButton, WrInput, WrPopover],\n})\nexport class WrEditor implements FormValueControl<WrEditorValue> {\n /**\n * The document as a {@link WrEditorJson} tree; `null` when nothing is written.\n * Bound by `[formField]`, or two-way via `[(value)]`.\n */\n readonly value = model<WrEditorValue>(null);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /**\n * Disable the editor and its toolbar. Bound automatically from the field's\n * disabled state when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse edits while the text stays reachable, selectable and announced.\n * Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * Set before the editor mounts, it means ProseMirror is never started: the\n * document is drawn as ordinary markup in a focusable `role=\"group\"` that\n * keeps the tab stop and carries the editor's name, so a viewer costs no\n * editor and the structure of what it shows is still announced. `aria-readonly`\n * is deliberately absent there — ARIA does not allow it on `group`, and\n * `aria-disabled`, the only attribute that would apply, means something else —\n * so the cue is the `wr-editor--readonly` class. The toolbar goes inert, since\n * none of its tools can apply; a pure viewer binds `[toolbar]=\"false\"`.\n *\n * A view that is already mounted stays mounted, refuses typing, paste, drop,\n * the shortcuts and every toolbar command, and reports `aria-readonly` on its\n * surface as before.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Hint shown while the document is empty, and exposed as `aria-placeholder`.\n *\n * @default ''\n */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name of the text — of the surface, or of the document a\n * read-only editor draws in its place. Falls back to the surrounding\n * `<wr-form-field>`'s label, then to `editor.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * The toolbar's tools, in order, with `'|'` between groups; `false` hides it.\n *\n * @default WR_EDITOR_TOOLBAR\n */\n readonly toolbar = input<readonly WrEditorTool[] | false>(WR_EDITOR_TOOLBAR);\n\n private readonly document = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /**\n * Ambient reading direction, read by the toolbar's arrow keys. Optional so a\n * bare `TestBed` needs no provider; `null` means LTR.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n /** @internal */\n protected readonly linkField = inject(WrEditorLinkField, { self: true });\n\n /** The surrounding `<wr-form-field>`'s error state, read past the editor's own shield. @internal */\n protected readonly fieldAria = useFormFieldAria({ skipSelf: true });\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'editor.label', 'Rich text');\n\n /**\n * The field's label names the surface, when there is one — a\n * `contenteditable` is not labelable, so the field's `<label for>` cannot\n * reach it. An explicit `ariaLabel` still wins over both.\n */\n protected readonly labelledBy = computed(() => (this.ariaLabel() ? null : this.fieldAria.labelledBy()));\n\n /** `null` while the field's label carries the name. */\n protected readonly accessibleName = computed(() => (this.labelledBy() ? null : this.resolvedAriaLabel()));\n\n protected readonly surfaceId = `wr-editor-${nextId++}`;\n\n /** ProseMirror owns the surface from here on; until then the preview stands in. */\n protected readonly mounted = signal(false);\n\n /**\n * Read-only and nothing mounted: the preview is not standing in for a surface,\n * it IS the editor, and the surface is not rendered at all. One id, one name\n * and one tab stop move onto it with the job. @internal\n */\n protected readonly staticMode = computed(() => !this.mounted() && this.readonly());\n\n protected readonly focused = signal(false);\n\n private readonly editorState = signal<EditorState | null>(null);\n\n /**\n * Whether `value` holds something the editor could not read, so the document\n * on screen is not the one the model holds — empty at mount, or the previous\n * record after a write. Edits are refused until a readable value arrives:\n * the first keystroke would otherwise replace the stored value with whatever\n * is on screen, and the only sign of it was a dev-mode warning.\n */\n private readonly refused = signal(false);\n\n /** Read-only by the input, or because the value was refused. @internal */\n protected readonly locked = computed(() => this.readonly() || this.refused());\n\n /** Apple keyboards name the modifier ⌘. Read in the browser only — see `mount()`. */\n private readonly apple = signal(false);\n\n // Optional, both of them: exactly one is in the DOM at a time, and which one\n // is the difference between a mounted editor and the static document.\n private readonly surface = viewChild<ElementRef<HTMLElement>>('surface');\n private readonly staticDoc = viewChild<ElementRef<HTMLElement>>('staticDoc');\n // `read`, because `#tool` sits on a `wr-btn` and would otherwise resolve to the component.\n private readonly toolButtons = viewChildren<unknown, ElementRef<HTMLButtonElement>>('tool', { read: ElementRef });\n private readonly linkPopover = viewChild<WrPopover>('linkPopover');\n\n private view: EditorView | null = null;\n /**\n * The value the live document was last read from or written as. A write from\n * outside that equals it is the document already on screen — an echo of the\n * editor's own emit, or a consumer writing back what it was handed — and must\n * neither re-parse nor reset the selection.\n */\n private lastSerialized: WrEditorValue | undefined = undefined;\n private linkToSurface = false;\n /**\n * Whether the static path has already named the refusal the model is holding.\n * A read-only editor reports one itself, and a mount that follows would\n * otherwise warn a second time about the same value.\n */\n private refusalWarned = false;\n\n // Labels\n\n protected readonly toolbarLabel = wrReadI18nText('editor.toolbar', 'Formatting');\n protected readonly linkUrlLabel = wrReadI18nText('editor.linkUrl', 'Link address');\n protected readonly linkApplyLabel = wrReadI18nText('editor.linkApply', 'Apply');\n protected readonly linkRemoveLabel = wrReadI18nText('editor.linkRemove', 'Remove link');\n protected readonly linkInvalidLabel = wrReadI18nText('editor.linkInvalid', 'This address cannot be used as a link.');\n protected readonly taskDoneLabel = wrReadI18nText('editor.taskDone', 'Done:');\n protected readonly taskTodoLabel = wrReadI18nText('editor.taskTodo', 'To do:');\n private readonly keyCtrl = wrReadI18nText('editor.keyCtrl', 'Ctrl');\n private readonly keyShift = wrReadI18nText('editor.keyShift', 'Shift');\n private readonly keyAlt = wrReadI18nText('editor.keyAlt', 'Alt');\n private readonly headingLabel = useI18nFormatter('editor.heading', 'Heading {{level}}');\n private readonly shortcutLabel = useI18nFormatter('editor.shortcut', '{{label}} ({{keys}})');\n\n private readonly toolLabels: Readonly<Record<WrEditorCommandTool, Signal<string>>> = {\n bold: wrReadI18nText('editor.bold', 'Bold'),\n italic: wrReadI18nText('editor.italic', 'Italic'),\n underline: wrReadI18nText('editor.underline', 'Underline'),\n strike: wrReadI18nText('editor.strike', 'Strikethrough'),\n code: wrReadI18nText('editor.code', 'Inline code'),\n paragraph: wrReadI18nText('editor.paragraph', 'Paragraph'),\n heading1: computed(() => this.headingLabel({ level: 1 })),\n heading2: computed(() => this.headingLabel({ level: 2 })),\n heading3: computed(() => this.headingLabel({ level: 3 })),\n bulletList: wrReadI18nText('editor.bulletList', 'Bulleted list'),\n orderedList: wrReadI18nText('editor.orderedList', 'Numbered list'),\n blockquote: wrReadI18nText('editor.blockquote', 'Quote'),\n codeBlock: wrReadI18nText('editor.codeBlock', 'Code block'),\n link: wrReadI18nText('editor.link', 'Insert link'),\n horizontalRule: wrReadI18nText('editor.horizontalRule', 'Horizontal line'),\n undo: wrReadI18nText('editor.undo', 'Undo'),\n redo: wrReadI18nText('editor.redo', 'Redo'),\n };\n\n // Toolbar\n\n /**\n * The bound tools as drawn: each tool once, and separators only BETWEEN two\n * groups — a list filtered from `WR_EDITOR_TOOLBAR`, or built by hand, can\n * leave a leading, trailing or doubled one behind.\n */\n protected readonly tools = computed<readonly WrEditorTool[]>(() => {\n const bound = this.toolbar();\n if (!bound) return [];\n const out: WrEditorTool[] = [];\n for (const tool of bound) {\n if (tool === '|' && (out.length === 0 || out[out.length - 1] === '|')) continue;\n if (tool !== '|' && out.includes(tool)) continue;\n out.push(tool);\n }\n if (out[out.length - 1] === '|') out.pop();\n return out;\n });\n\n /** The tools that are buttons, in order — what the roving tab stop moves over. */\n private readonly buttons = computed(() => this.tools().filter((tool): tool is WrEditorCommandTool => tool !== '|'));\n\n /** Each drawn entry's index among the buttons, `-1` for a separator. @internal */\n protected readonly buttonIndex = computed(() => {\n let index = 0;\n return this.tools().map(tool => (tool === '|' ? -1 : index++));\n });\n\n private readonly commands = computed(() => {\n const schema = editorSchema();\n return new Map(this.buttons().map(tool => [tool, toolCommand(tool, schema)]));\n });\n\n /** Every button's pressed and available state at the current selection. @internal */\n protected readonly toolStates = computed<ReadonlyMap<WrEditorCommandTool, WrToolState>>(() => {\n const state = this.editorState();\n const editable = this.canEdit();\n const commands = this.commands();\n return new Map(\n this.buttons().map(tool => {\n const command = commands.get(tool);\n return [\n tool,\n {\n tool,\n active: !!state && toolActive(tool, state),\n available: !!state && editable && !!command && command(state),\n },\n ];\n })\n );\n });\n\n private readonly rovingIndex = signal(0);\n\n /**\n * The one button in the tab order. It follows the user, and moves off a tool\n * that stopped applying so the toolbar never loses its tab stop — unless NO\n * tool applies (read-only, disabled), where it stays put, because there is\n * nothing to reach.\n */\n private readonly tabStop = computed(() => {\n const buttons = this.buttons();\n const states = this.toolStates();\n const current = Math.min(this.rovingIndex(), Math.max(buttons.length - 1, 0));\n if (states.get(buttons[current])?.available) return current;\n const first = buttons.findIndex(tool => states.get(tool)?.available);\n return first >= 0 ? first : current;\n });\n\n /** Whether the live document is empty — pre-mount, whether the value is. */\n private readonly empty = computed(() => {\n const state = this.editorState();\n if (state) return isEmptyDoc(state.doc);\n const value = this.value();\n return value === null || value === undefined;\n });\n\n /** The task-item words, handed to ProseMirror through its node views. */\n private readonly nodeViews = computed(() => ({\n list_item: listItemView({ done: this.taskDoneLabel(), todo: this.taskTodoLabel() }),\n }));\n\n /**\n * Nothing in the static mode: a hint for input, where no input is taken, and\n * `aria-placeholder` is not among the attributes `role=\"group\"` allows — so\n * one drawn there would be text no screen reader ever reaches.\n */\n protected readonly ariaPlaceholder = computed(() =>\n this.placeholder() && this.empty() && !this.staticMode() ? this.placeholder() : null\n );\n\n // Link panel\n\n protected readonly linkDraft = signal('');\n\n /** Whether the selection is in a link — what the panel's remove button needs. */\n protected readonly linkActive = computed(() => this.toolStates().get('link')?.active ?? false);\n\n /**\n * The value rendered by Angular rather than by ProseMirror: on the server, for\n * the first browser frame, and — for as long as it lasts — in the static mode,\n * where no mount is coming. The value goes through the schema and back out,\n * so it shows exactly the document the editor would mount — defaults filled\n * in, undeclared attributes gone — and nothing for a value it refuses.\n */\n protected readonly preview = computed<WrEditorJson | null>(() => {\n if (this.mounted()) return null;\n try {\n return readValue(this.value(), editorSchema()).toJSON() as WrEditorJson;\n } catch (error) {\n // The browser warns from `sync()` — at the mount, or at the write itself\n // while read-only; the server has neither to wait for.\n if (!this.isBrowser && isDevMode()) this.warnRefused(error);\n return null;\n }\n });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.focused()) parts.push('wr-editor--focused');\n if (this.disabled()) parts.push('wr-editor--disabled');\n else if (this.locked()) parts.push('wr-editor--readonly');\n if (this.refused()) parts.push('wr-editor--refused');\n return parts.join(' ');\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('editor');\n // Outside writes: a form reset, a server load, a patch. Skipped when the\n // value is the document already on screen — see `lastSerialized`.\n effect(() => {\n const value = this.value();\n untracked(() => this.sync(value));\n });\n\n // `editable` and the placeholder are functions ProseMirror asks on every\n // update, so poking it is enough to make it ask again.\n effect(() => {\n this.readonly();\n this.disabled();\n this.refused();\n this.placeholder();\n untracked(() => this.view?.setProps({}));\n });\n\n // The task-item words live in node views, which ProseMirror only redraws\n // when the `nodeViews` prop itself changes.\n effect(() => {\n const nodeViews = this.nodeViews();\n untracked(() => this.view?.setProps({ nodeViews }));\n });\n\n // The roving tab stop is written to the DOM rather than bound: `wr-btn`\n // binds `[attr.tabindex]` on its host (`null` for a native button), and a\n // host binding runs after the template's and removes the attribute on the\n // first pass. Nothing rewrites it after that, so a write after render sticks.\n afterRenderEffect({\n write: () => {\n const stop = this.tabStop();\n this.toolButtons().forEach((ref, index) => (ref.nativeElement.tabIndex = index === stop ? 0 : -1));\n },\n });\n\n // `afterNextRender` alone is not the guard: it keys on the global server\n // flag, not on `PLATFORM_ID`, so a platform test would still run it.\n if (!this.isBrowser) return;\n\n // Mount on the first render that is not read-only — usually the very first\n // one, and otherwise the one that lifts `readonly`. A WRITE phase, so the\n // surface the template puts back is already in the DOM by the time\n // `mount()` looks for it; `mount()` itself happens once and never undoes.\n afterRenderEffect({\n write: () => {\n if (!this.readonly()) this.mount();\n },\n });\n }\n\n /**\n * Focus the editor — what Signal Forms calls to focus this control. Whatever\n * is on screen takes it: the mounted surface, or the static document, which\n * keeps a tab stop for exactly this reason.\n */\n focus(options?: FocusOptions): void {\n const view = this.view;\n // ProseMirror's own `focus()` is a no-op while the view is not editable,\n // and read-only has to stay focusable.\n if (view?.editable) view.focus();\n else (this.surface() ?? this.staticDoc())?.nativeElement.focus(options);\n }\n\n // Template handlers\n\n protected label(tool: WrEditorCommandTool): string {\n return this.toolLabels[tool]();\n }\n\n protected icon(tool: WrEditorCommandTool): readonly string[] {\n return TOOL_ICONS[tool];\n }\n\n protected isToggle(tool: WrEditorCommandTool): boolean {\n return TOGGLES.has(tool);\n }\n\n /** The tooltip: the label, with the shortcut when the tool has one. */\n protected tooltip(tool: WrEditorCommandTool): string {\n const shortcut = SHORTCUTS[tool];\n if (!shortcut) return this.label(tool);\n const keys = this.apple()\n ? `${shortcut.alt ? '⌥' : ''}${shortcut.shift ? '⇧' : ''}⌘${shortcut.key}`\n : [\n this.keyCtrl(),\n ...(shortcut.alt ? [this.keyAlt()] : []),\n ...(shortcut.shift ? [this.keyShift()] : []),\n shortcut.key,\n ].join('+');\n return this.shortcutLabel({ label: this.label(tool), keys });\n }\n\n /** `aria-keyshortcuts` — key names from the ARIA spec, never localised. */\n protected keyShortcuts(tool: WrEditorCommandTool): string | null {\n const shortcut = SHORTCUTS[tool];\n if (!shortcut) return null;\n const mod = this.apple() ? 'Meta' : 'Control';\n const combo = `${mod}+${shortcut.alt ? 'Alt+' : ''}${shortcut.shift ? 'Shift+' : ''}${shortcut.key}`;\n return tool === 'redo' && !this.apple() ? `${combo} Control+Y` : combo;\n }\n\n protected state(tool: WrEditorCommandTool): WrToolState | undefined {\n return this.toolStates().get(tool);\n }\n\n /**\n * A toolbar button was activated.\n *\n * By pointer, focus never left the text (`mousedown` is cancelled), so the\n * caret is put back where the command left it. By keyboard, focus stays on the\n * button, as the toolbar pattern asks — unless the tool no longer applies,\n * which disables it: a disabled button drops its focus on `<body>`, so the text\n * takes it first.\n */\n protected onToolClick(tool: WrEditorCommandTool, event: MouseEvent): void {\n const view = this.view;\n const command = this.commands().get(tool);\n if (!view || !command || !this.canEdit()) return;\n command(view.state, view.dispatch, view);\n if (event.detail !== 0 || !this.state(tool)?.available) view.focus();\n }\n\n protected onToolFocus(index: number): void {\n this.rovingIndex.set(index);\n }\n\n /** The APG toolbar keys: the arrows rove and wrap, Home and End jump. */\n protected onToolbarKeydown(event: KeyboardEvent): void {\n if (wrIsComposing(event) || event.altKey || event.ctrlKey || event.metaKey) return;\n const buttons = this.toolButtons().map(ref => ref.nativeElement);\n const current = buttons.indexOf(event.target as HTMLButtonElement);\n if (current < 0) return;\n const reachable = buttons.map((button, index) => (button.disabled ? -1 : index)).filter(index => index >= 0);\n if (!reachable.length) return;\n\n const rtl = this.dir?.value === 'rtl';\n const at = reachable.indexOf(current);\n let next: number;\n switch (event.key) {\n case 'ArrowRight':\n next = reachable[(at + (rtl ? -1 : 1) + reachable.length) % reachable.length];\n break;\n case 'ArrowLeft':\n next = reachable[(at + (rtl ? 1 : -1) + reachable.length) % reachable.length];\n break;\n case 'Home':\n next = reachable[0];\n break;\n case 'End':\n next = reachable[reachable.length - 1];\n break;\n default:\n return;\n }\n event.preventDefault();\n this.rovingIndex.set(next);\n buttons[next].focus();\n }\n\n /** `touch` once focus leaves the whole control — not when it moves between its own parts. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as globalThis.Node | null;\n if (next && this.withinControl(next)) return;\n const fromPanel = this.inLinkPanel(event.target as globalThis.Node);\n\n // Chromium fires a `focusout` with no `relatedTarget` when the focused\n // element is REMOVED — the link panel closing with focus inside it, or its\n // remove button leaving — and the popover hands focus back only after that.\n // It does the same when Tab runs off the end of the document, which is where\n // the overlay container sits. So where focus went is decided once it has\n // settled, or Escape on the panel marked the field touched with focus never\n // leaving the control.\n if (!next && fromPanel) {\n afterNextRender(\n () => {\n const active = this.document.activeElement;\n if (active && this.withinControl(active)) return;\n this.leaveLinkPanel();\n this.touch.emit();\n },\n { injector: this.injector }\n );\n return;\n }\n\n if (next && fromPanel) this.leaveLinkPanel();\n this.touch.emit();\n }\n\n protected onLinkOpened(): void {\n const state = this.view?.state;\n const range = state ? linkRange(state) : null;\n this.linkDraft.set(range ? String(range.mark.attrs['href'] ?? '') : '');\n this.linkField.invalid.set(false);\n afterNextRender(() => this.focusLinkInput(), { injector: this.injector });\n }\n\n protected onLinkClosed(): void {\n // Back to the text when the panel was opened from it (Mod-K) or when a link\n // was just applied; otherwise the popover has already handed focus back to\n // the toolbar button, which is where Escape should leave it.\n //\n // Only while focus is where the popover left it — on the link button — or\n // nowhere. A click elsewhere on the page closes the panel too, and by then\n // it has put focus where the user wanted it; taking it back sent their next\n // keystrokes into this editor.\n const toSurface = this.linkToSurface;\n this.linkToSurface = false;\n this.linkField.invalid.set(false);\n if (!toSurface) return;\n const active = this.document.activeElement;\n const linkButton = this.toolButtons()[this.buttons().indexOf('link')]?.nativeElement;\n if (!active || active === this.document.body || active === linkButton) this.view?.focus();\n }\n\n protected onLinkInput(event: Event): void {\n this.linkDraft.set((event.target as HTMLInputElement).value);\n this.linkField.invalid.set(false);\n }\n\n protected applyLink(event: Event): void {\n event.preventDefault();\n const view = this.view;\n if (!view || !this.canEdit()) return;\n const draft = this.linkDraft().trim();\n // An emptied field on an existing link means \"no link\".\n if (!draft && this.linkActive()) {\n this.removeLink();\n return;\n }\n const href = draft ? safeUrl(draft, 'link') : null;\n if (!href) {\n this.linkField.invalid.set(true);\n this.focusLinkInput();\n return;\n }\n if (!setLink(href)(view.state, view.dispatch)) return;\n this.linkToSurface = true;\n this.linkPopover()?.close();\n }\n\n protected removeLink(): void {\n const view = this.view;\n if (!view || !this.canEdit()) return;\n removeLink(view.state, view.dispatch);\n this.linkToSurface = true;\n this.linkPopover()?.close();\n }\n\n // Preview helpers — the template's typed view of untyped JSON.\n\n protected nodesOf(raw: unknown): readonly WrEditorJson[] {\n return Array.isArray(raw) ? (raw as readonly WrEditorJson[]) : [];\n }\n\n protected nodeOf(raw: unknown): WrEditorJson {\n return raw as WrEditorJson;\n }\n\n protected markAt(node: WrEditorJson, depth: number): WrEditorMarkJson | null {\n return node.marks?.[depth] ?? null;\n }\n\n protected attr(node: WrEditorJson | WrEditorMarkJson, name: string): unknown {\n return node.attrs?.[name] ?? null;\n }\n\n protected text(node: WrEditorJson | WrEditorMarkJson, name: string): string | null {\n const value = node.attrs?.[name];\n return typeof value === 'string' ? value : null;\n }\n\n protected textOf(node: WrEditorJson): string {\n return (node.content ?? []).map(child => child.text ?? '').join('');\n }\n\n // Internals\n\n /** Whether an edit may happen at all — not while read-only, disabled or refused. */\n private canEdit(): boolean {\n return !this.readonly() && !this.disabled() && !this.refused();\n }\n\n private mount(): void {\n // Once and for all: a second call would drop a live document, and going\n // back to read-only is not a reason to throw a session's history away.\n if (this.view) return;\n // The template draws the surface in every state but the static one, which\n // this is never called out of — after the render that puts it back.\n const surface = this.surface();\n if (!surface) return;\n this.apple.set((this.platform.userAgent ?? '').toLowerCase().includes('mac'));\n const value = untracked(this.value);\n const schema = editorSchema();\n let doc: Node;\n try {\n doc = readValue(value, schema);\n } catch (error) {\n // Never twice for a refusal the static path has already named.\n if (isDevMode() && !this.refusalWarned) this.warnRefused(error);\n doc = schema.topNodeType.createAndFill()!;\n // An empty document over a stored value: see `refused`.\n this.refused.set(true);\n }\n\n const state = this.createState(doc);\n this.view = new EditorView(\n { mount: surface.nativeElement },\n {\n state,\n editable: () => untracked(() => this.canEdit()),\n dispatchTransaction: tr => this.dispatch(tr),\n decorations: current => this.placeholderDecorations(current),\n nodeViews: untracked(this.nodeViews),\n handleKeyDown: (_view, event) => this.onSurfaceKeydown(event),\n }\n );\n this.lastSerialized = value;\n this.editorState.set(state);\n this.mounted.set(true);\n this.destroyRef.onDestroy(() => {\n this.view?.destroy();\n this.view = null;\n });\n }\n\n private createState(doc: Node): EditorState {\n const plugins =\n this.view?.state.plugins ??\n editorPlugins(doc.type.schema, {\n apple: untracked(this.apple),\n canEdit: () => untracked(() => this.canEdit()),\n });\n return EditorState.create({ doc, plugins });\n }\n\n private dispatch(tr: Transaction): void {\n const view = this.view;\n if (!view) return;\n const previous = view.state;\n const next = previous.apply(tr);\n view.updateState(next);\n this.editorState.set(next);\n // A refused transaction leaves the document as it was even though it asked\n // to change it; that is not an edit, and must not reach the model.\n if (next.doc !== previous.doc) this.emit(next.doc);\n }\n\n private emit(doc: Node): void {\n const out = writeValue(doc);\n if (out === this.lastSerialized) return;\n this.lastSerialized = out;\n this.value.set(out);\n }\n\n /**\n * Bring an outside write into the view.\n *\n * Compared as DOCUMENTS, never as values: a tree that leaves a default\n * attribute out, or carries one the schema does not declare, differs from what\n * the editor would write while the documents are equal — and an equal document\n * is left alone, selection and history included. A different one replaces the\n * state wholesale, history with it, which is right for a form reset or a server\n * load: undo back into content the app replaced would be wrong. The normalised\n * form is never written back — that would mark the field dirty on load. A write\n * that arrives mid-composition (IME) replaces the composition too: the model is\n * the source of truth.\n */\n private sync(value: WrEditorValue): void {\n const view = this.view;\n if (!view) {\n // Nothing to bring it into. `preview()` redraws it either way; what it\n // cannot do is REPORT a value it could not read, and in the static mode\n // no mount is coming to do that — so the check happens here instead.\n // Before a mount that IS coming it is `mount()` that reports, and on the\n // server `preview()` does, each exactly once.\n if (this.isBrowser && untracked(this.readonly)) this.readStatically(value);\n return;\n }\n if (value === this.lastSerialized) return;\n\n let doc: Node;\n try {\n doc = readValue(value, editorSchema());\n } catch (error) {\n if (isDevMode()) this.warnRefused(error);\n // The model now holds what the screen does not show.\n this.refused.set(true);\n return;\n }\n\n this.refused.set(false);\n this.lastSerialized = value;\n if (doc.eq(view.state.doc)) return;\n this.replaceState(doc);\n }\n\n /**\n * The check `mount()` makes, made without a mount: the same warning and the\n * same `refused` flag, so an unreadable value is refused whether or not\n * ProseMirror ever starts. Without it a read-only editor met one with silence\n * — `preview()` renders nothing for a document it cannot read, and the model\n * goes on holding a value nothing has said a word about.\n *\n * The parsed document is dropped; `preview()` reads its own. The cost is one\n * extra parse per write, and only while read-only, where a write is rare.\n */\n private readStatically(value: WrEditorValue): void {\n try {\n readValue(value, editorSchema());\n this.refused.set(false);\n this.refusalWarned = false;\n } catch (error) {\n if (isDevMode()) {\n this.warnRefused(error);\n this.refusalWarned = true;\n }\n this.refused.set(true);\n }\n }\n\n private replaceState(doc: Node): void {\n const state = this.createState(doc);\n this.view!.updateState(state);\n this.editorState.set(state);\n }\n\n private placeholderDecorations(state: EditorState): DecorationSet | null {\n const text = untracked(this.placeholder);\n if (!text || !isEmptyDoc(state.doc)) return null;\n const first = state.doc.firstChild!;\n return DecorationSet.create(state.doc, [\n Decoration.node(0, first.nodeSize, { class: 'wr-editor__placeholder', 'data-placeholder': text }),\n ]);\n }\n\n /**\n * Mod-K opens the link panel. Its propagation stops here: `<wr-command-palette>`\n * binds the same chord on the document, and `WrHotkey` deliberately does not\n * skip an event another listener already handled.\n */\n private onSurfaceKeydown(event: KeyboardEvent): boolean {\n if (wrIsComposing(event) || event.altKey || event.shiftKey) return false;\n const mod = untracked(this.apple) ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;\n if (!mod || (event.key.toLowerCase() !== 'k' && event.code !== 'KeyK')) return false;\n const popover = this.linkPopover();\n if (!popover || !untracked(this.toolStates).get('link')?.available) return false;\n event.stopPropagation();\n this.linkToSurface = true;\n popover.open();\n return true;\n }\n\n private focusLinkInput(): void {\n const input = this.document.getElementById(this.linkField.controlId()) as HTMLInputElement | null;\n input?.focus();\n input?.select();\n }\n\n /**\n * Focus left the link panel for somewhere outside the control — Tab, Shift+Tab,\n * a click elsewhere. The panel is not a focus trap, and left open it stays\n * anchored to a control the user has left, whose next close would then pull\n * focus back into the text. Closed with focus left where it went.\n */\n private leaveLinkPanel(): void {\n this.linkToSurface = false;\n this.linkPopover()?.close();\n }\n\n /** Whether a node is part of this control: the host, or its link panel. */\n private withinControl(node: globalThis.Node): boolean {\n return this.host.nativeElement.contains(node) || this.inLinkPanel(node);\n }\n\n private inLinkPanel(node: globalThis.Node): boolean {\n const panel = this.document.getElementById(this.linkField.panelId);\n if (!panel) return false;\n // The popover focuses its own pane before the input takes over.\n return panel.contains(node) || node === panel.closest('.cdk-overlay-pane');\n }\n\n private warnRefused(error: unknown): void {\n const reason = error instanceof Error ? error.message : String(error);\n warn(\n 'the bound value could not be read and was ignored — the editor keeps the document it had and refuses ' +\n `edits until it is given a value it can read, so the stored one is not overwritten. ${reason}`\n );\n }\n}\n","@if (tools().length) {\n <div class=\"wr-editor__toolbar\" role=\"toolbar\" [attr.aria-label]=\"toolbarLabel()\" [attr.aria-controls]=\"surfaceId\">\n @for (item of tools(); track $index; let n = $index) {\n @if (item === '|') {\n <span class=\"wr-editor__separator\" aria-hidden=\"true\"></span>\n } @else if (item === 'link') {\n <!-- The link button hosts the link panel, so it carries the popover's own\n `aria-haspopup` / `aria-expanded` / `aria-controls` — and no tooltip,\n since one element cannot host `[wrPopover]` twice; its name and\n `aria-keyshortcuts` still say what the others' tooltips say. No\n `aria-pressed` either: a button that opens a popup is not a toggle,\n and the panel's remove button is where \"in a link\" is announced. -->\n <button\n #tool\n #linkPopover=\"wrPopover\"\n wr-btn\n type=\"button\"\n class=\"wr-editor__tool\"\n [class.wr-editor__tool--active]=\"state(item)?.active\"\n [disabled]=\"!state(item)?.available\"\n [attr.aria-label]=\"label(item)\"\n [attr.aria-keyshortcuts]=\"keyShortcuts(item)\"\n [wrPopover]=\"linkPanel\"\n [ariaLabel]=\"label(item)\"\n (opened)=\"onLinkOpened()\"\n (closed)=\"onLinkClosed()\"\n (focus)=\"onToolFocus(buttonIndex()[n])\"\n (keydown)=\"onToolbarKeydown($event)\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <svg\n class=\"wr-editor__icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n @for (d of icon(item); track $index) {\n <path [attr.d]=\"d\" />\n }\n </svg>\n </button>\n } @else {\n <button\n #tool\n wr-btn\n type=\"button\"\n class=\"wr-editor__tool\"\n mode=\"tooltip\"\n [class.wr-editor__tool--active]=\"state(item)?.active\"\n [disabled]=\"!state(item)?.available\"\n [attr.aria-pressed]=\"isToggle(item) ? (state(item)?.active ? 'true' : 'false') : null\"\n [attr.aria-label]=\"label(item)\"\n [attr.aria-keyshortcuts]=\"keyShortcuts(item)\"\n [wrPopover]=\"tooltip(item)\"\n (click)=\"onToolClick(item, $event)\"\n (focus)=\"onToolFocus(buttonIndex()[n])\"\n (keydown)=\"onToolbarKeydown($event)\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <svg\n class=\"wr-editor__icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n @for (d of icon(item); track $index) {\n <path [attr.d]=\"d\" />\n }\n </svg>\n </button>\n }\n }\n </div>\n}\n\n<!--\n The document drawn by Angular, in either of the two ways it stands on screen.\n\n In the STATIC mode — read-only with nothing mounted — it is the editor, for as\n long as `readonly` holds, so it takes the id, the name, the field's state and\n the tab stop the surface below would have carried, and that surface is not\n rendered at all: two elements with one id, or a nameless empty textbox beside\n the text, is what rendering both would mean. A focusable `role=\"group\"` and not\n a textbox, because every descendant of a textbox is presentational — the\n headings, lists and tables being shown would stop being announced, which is the\n whole point of showing a document. No `aria-readonly`: ARIA does not allow it\n on `group`, and `.wr-editor--readonly` on the host is the cue instead.\n\n Otherwise it is the preview that stands in until ProseMirror mounts — on the\n server, and for the first browser frame — and carries nothing of the surface's.\n\n Either way it is a SIBLING of the mount surface, never inside it: `{ mount }`\n replaces the element's children, and nodes Angular owns would be deleted out\n from under the next change detection.\n-->\n@if (staticMode()) {\n <div\n #staticDoc\n class=\"wr-editor__preview wr-editor__preview--static wr-editor__content\"\n role=\"group\"\n [id]=\"surfaceId\"\n [attr.aria-label]=\"accessibleName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n (focus)=\"focused.set(true)\"\n (blur)=\"focused.set(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"previewContent\" />\n </div>\n} @else {\n @if (preview()) {\n <div class=\"wr-editor__preview wr-editor__content\">\n <ng-container [ngTemplateOutlet]=\"previewContent\" />\n </div>\n }\n\n <!--\n The mount surface. Angular binds every attribute it needs, so the prerendered\n page and the synchronous first render already carry the role, the name and the\n field's error state; ProseMirror adds only its own class, `contenteditable` and\n `translate`, and never touches an attribute it did not set. No Angular child\n ever lives in here.\n -->\n <div\n #surface\n class=\"wr-editor__surface wr-editor__content\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [id]=\"surfaceId\"\n [hidden]=\"!mounted()\"\n [attr.aria-label]=\"accessibleName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-readonly]=\"locked() && !disabled() ? 'true' : null\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [attr.aria-placeholder]=\"ariaPlaceholder()\"\n [attr.tabindex]=\"locked() && !disabled() ? 0 : null\"\n (focus)=\"focused.set(true)\"\n (blur)=\"focused.set(false)\"\n ></div>\n}\n\n<!-- The document itself, written once for both of the containers above. -->\n<ng-template #previewContent>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: preview()?.content }\" />\n</ng-template>\n\n<!--\n The popover styles its panel as `.wr-popover-overlay > *`, which is this form,\n so the form stays a plain block and the layout lives one level in.\n-->\n<ng-template #linkPanel>\n <form\n class=\"wr-editor-link\"\n novalidate\n [id]=\"linkField.panelId\"\n (submit)=\"applyLink($event)\"\n (focusout)=\"onFocusOut($event)\"\n >\n <div class=\"wr-editor-link__body\">\n <label class=\"wr-editor-link__label\" [attr.for]=\"linkField.controlId()\">{{ linkUrlLabel() }}</label>\n <input\n wrInput\n class=\"wr-editor-link__input\"\n type=\"text\"\n inputmode=\"url\"\n autocomplete=\"url\"\n spellcheck=\"false\"\n [value]=\"linkDraft()\"\n (input)=\"onLinkInput($event)\"\n />\n @if (linkField.invalid()) {\n <p class=\"wr-editor-link__error\" role=\"alert\" [id]=\"linkField.errorId\">{{ linkInvalidLabel() }}</p>\n }\n <div class=\"wr-editor-link__actions\">\n @if (linkActive()) {\n <button wr-btn type=\"button\" class=\"wr-editor-link__remove\" (click)=\"removeLink()\">\n {{ linkRemoveLabel() }}\n </button>\n }\n <button wr-btn type=\"submit\" color=\"primary\" class=\"wr-editor-link__apply\">{{ linkApplyLabel() }}</button>\n </div>\n </div>\n </form>\n</ng-template>\n\n<!--\n Recursion runs through `ngTemplateOutlet` rather than a child component, so the\n preview is exactly the document with no host element between a `<ul>` and its\n `<li>`.\n-->\n<ng-template #previewBlocks let-raw>\n @for (node of nodesOf(raw); track $index) {\n @switch (node.type) {\n @case ('paragraph') {\n <p [class.wr-editor__placeholder]=\"ariaPlaceholder() !== null\" [attr.data-placeholder]=\"ariaPlaceholder()\">\n <ng-container [ngTemplateOutlet]=\"previewInline\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </p>\n }\n @case ('heading') {\n @switch (attr(node, 'level')) {\n @case (2) {\n <h2>\n <ng-container\n [ngTemplateOutlet]=\"previewInline\"\n [ngTemplateOutletContext]=\"{ $implicit: node.content }\"\n />\n </h2>\n }\n @case (3) {\n <h3>\n <ng-container\n [ngTemplateOutlet]=\"previewInline\"\n [ngTemplateOutletContext]=\"{ $implicit: node.content }\"\n />\n </h3>\n }\n @default {\n <h1>\n <ng-container\n [ngTemplateOutlet]=\"previewInline\"\n [ngTemplateOutletContext]=\"{ $implicit: node.content }\"\n />\n </h1>\n }\n }\n }\n @case ('blockquote') {\n <blockquote>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </blockquote>\n }\n @case ('code_block') {\n <pre><code>{{ textOf(node) }}</code></pre>\n }\n @case ('horizontal_rule') {\n <hr />\n }\n @case ('bullet_list') {\n <ul>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </ul>\n }\n @case ('ordered_list') {\n <ol [attr.start]=\"attr(node, 'order') === 1 ? null : attr(node, 'order')\">\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </ol>\n }\n @case ('list_item') {\n @let checked = attr(node, 'checked');\n @if (checked === null) {\n <li>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </li>\n } @else {\n <li class=\"wr-editor__item wr-editor__item--task\" [attr.data-checked]=\"checked\">\n <span class=\"wr-editor__task\" [class.wr-editor__task--checked]=\"checked === true\" aria-hidden=\"true\"></span>\n <span class=\"wr-editor__sr-only\">{{ checked === true ? taskDoneLabel() : taskTodoLabel() }}</span>\n <div class=\"wr-editor__task-body\">\n <ng-container\n [ngTemplateOutlet]=\"previewBlocks\"\n [ngTemplateOutletContext]=\"{ $implicit: node.content }\"\n />\n </div>\n </li>\n }\n }\n @case ('table') {\n <table>\n <tbody>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </tbody>\n </table>\n }\n @case ('table_row') {\n <tr>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </tr>\n }\n @case ('table_header') {\n <th [style.text-align]=\"text(node, 'align')\">\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </th>\n }\n @case ('table_cell') {\n <td [style.text-align]=\"text(node, 'align')\">\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </td>\n }\n }\n }\n</ng-template>\n\n<ng-template #previewInline let-raw>\n @for (node of nodesOf(raw); track $index) {\n <ng-container [ngTemplateOutlet]=\"previewMarked\" [ngTemplateOutletContext]=\"{ $implicit: node, depth: 0 }\" />\n }\n</ng-template>\n\n<!-- One mark per level, outermost first — the order the schema ranks them in. -->\n<ng-template #previewMarked let-raw let-depth=\"depth\">\n @let node = nodeOf(raw);\n @let mark = markAt(node, depth);\n @if (mark) {\n @switch (mark.type) {\n @case ('link') {\n <a [href]=\"text(mark, 'href')\" [attr.title]=\"text(mark, 'title')\" rel=\"noopener noreferrer nofollow\"\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></a>\n }\n @case ('strong') {\n <strong\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></strong>\n }\n @case ('em') {\n <em\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></em>\n }\n @case ('underline') {\n <u\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></u>\n }\n @case ('strike') {\n <s\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></s>\n }\n @case ('code') {\n <code\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></code>\n }\n @default {\n <ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n />\n }\n }\n } @else {\n @switch (node.type) {\n @case ('text') {\n <ng-container>{{ node.text }}</ng-container>\n }\n @case ('hard_break') {\n <br />\n }\n @case ('image') {\n <img [src]=\"text(node, 'src')\" [alt]=\"text(node, 'alt') ?? ''\" [attr.title]=\"text(node, 'title')\" />\n }\n }\n }\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,iBAAiB;AAYvB,SAAS,SAAS,OAAgB,QAAc;CAC9C,YAAY,OAAO,CAAC;CACpB,MAAM,MAAM,OAAO,aAAa,KAAK;CACrC,IAAI,IAAI,SAAS,OAAO,aAAa,MAAM,IAAI,WAAW,2CAA2C;CACrG,IAAI,MAAK;CACT,OAAO;AACT;AAEA,SAAS,YAAY,OAAgB,OAAa;CAChD,IAAI,QAAQ,gBAAgB,MAAM,IAAI,WAAW,8CAA8C;CAC/F,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GACpE,MAAM,IAAI,WAAW,2CAA2C;CAElE,MAAM,OAAO;CACb,IAAI,OAAO,KAAK,YAAY,UAAU,MAAM,IAAI,WAAW,kDAAkD;CAC7G,IAAI,KAAK,YAAY,UAAa,OAAO,KAAK,YAAY,UACxD,MAAM,IAAI,WAAW,iCAAiC;CAExD,KAAK,MAAM,OAAO;EAAC;EAAS;EAAS;CAAS,GAAY;EACxD,MAAM,QAAQ,KAAK;EACnB,IAAI,UAAU,QAAW;EACzB,IAAI,QAAQ,SAAS;GACnB,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GACpE,MAAM,IAAI,WAAW,mCAAmC;GAE1D;EACF;EACA,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,MAAM,IAAI,WAAW,kBAAkB,IAAG,eAAgB;E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AA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAS,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CACP,aAAW,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAES,QAAM;IAAI,MAAM;IAAY,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAC5D,eAAa,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-editor.mjs","names":["nextId","DOCUMENT"],"sources":["../../../projects/lib/editor/internal/json.ts","../../../projects/lib/editor/internal/safe-url.ts","../../../projects/lib/editor/internal/schema.ts","../../../projects/lib/editor/internal/codec.ts","../../../projects/lib/editor/internal/commands.ts","../../../projects/lib/editor/internal/icons.ts","../../../projects/lib/editor/internal/link-field.ts","../../../projects/lib/editor/internal/list-item-view.ts","../../../projects/lib/editor/toolbar.ts","../../../projects/lib/editor/editor.ts","../../../projects/lib/editor/editor.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Node, Schema } from 'prosemirror-model';\n\nimport type { WrEditorJson } from '../types';\n\n/**\n * How deep a JSON value may nest before it is refused unread.\n *\n * Not the editing limit — that is `MAX_NESTING`, counted in quotes and list\n * items. This one is the stack's: `Node.fromJSON` and `check()` both recurse,\n * and about three thousand nested blocks overflow them. A document the editor\n * itself can produce is nowhere near it (eleven levels of list is under forty\n * JSON levels), so anything past it was not written by an editor.\n */\nconst MAX_JSON_DEPTH = 256;\n\n/**\n * An untrusted JSON value as a checked document, or a thrown `RangeError`.\n *\n * Both steps are needed. `nodeFromJSON` refuses an unknown node or mark, an\n * empty text node and an attribute its validator rejects — the URL policy\n * among them — but does NOT check content expressions; `check()` does, and\n * re-runs the validators besides. The shape pass in front keeps a malformed or\n * hostile value from reaching either: a non-object, a `text` that is not a\n * string, or nesting past {@link MAX_JSON_DEPTH}.\n */\nfunction readJson(value: unknown, schema: Schema): Node {\n assertShape(value, 0);\n const doc = schema.nodeFromJSON(value);\n if (doc.type !== schema.topNodeType) throw new RangeError('<wr-editor>: a JSON value is a `doc` node');\n doc.check();\n return doc;\n}\n\nfunction assertShape(value: unknown, depth: number): asserts value is WrEditorJson {\n if (depth > MAX_JSON_DEPTH) throw new RangeError('<wr-editor>: the JSON value nests too deeply');\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new RangeError('<wr-editor>: every JSON node is an object');\n }\n const node = value as Record<string, unknown>;\n if (typeof node['type'] !== 'string') throw new RangeError('<wr-editor>: every JSON node has a string `type`');\n if (node['text'] !== undefined && typeof node['text'] !== 'string') {\n throw new RangeError('<wr-editor>: `text` is a string');\n }\n for (const key of ['attrs', 'marks', 'content'] as const) {\n const child = node[key];\n if (child === undefined) continue;\n if (key === 'attrs') {\n if (typeof child !== 'object' || child === null || Array.isArray(child)) {\n throw new RangeError('<wr-editor>: `attrs` is an object');\n }\n continue;\n }\n if (!Array.isArray(child)) throw new RangeError(`<wr-editor>: \\`${key}\\` is an array`);\n for (const item of child) assertShape(item, depth + 1);\n }\n}\n\nexport { readJson };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nconst SCHEME_RE = /^([a-z][a-z0-9+.-]*):/i;\nconst ALLOWED_SCHEMES = new Set(['http', 'https', 'mailto', 'tel', 'ftp']);\nconst DATA_IMAGE_RE = /^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[a-z0-9+/=]+$/i;\n\n/**\n * Whitespace and control characters only: a hyphen has no business being\n * stripped out of a host name. Written as escapes rather than literal bytes — a\n * raw NUL inside a regex literal makes the file binary to every text tool.\n * Stripping control characters is the entire point: a browser ignores them before\n * resolving the scheme, so a check that reads the raw string sees a relative path\n * and waves `java\\u0000script:` straight through.\n */\n// eslint-disable-next-line no-control-regex\nconst URL_IGNORED_RE = /[\\s\\u0000-\\u001f\\u007f]/g;\n\n/**\n * The character references that can spell a scheme once something decodes them:\n * every numeric one, and the named ones for the colon and for the whitespace a\n * browser strips (`:`, `	`, `
`). Matched without regard to\n * case and with the semicolon optional, which is wider than any HTML or markdown\n * renderer decodes — the net only ever catches a URL nobody writes.\n */\nconst SCHEME_REFERENCE_RE = /&(?:#x([0-9a-f]+)|#(\\d+)|(colon|tab|newline));?/gi;\n\nfunction decodeSchemeReferences(url: string): string {\n return url.replace(SCHEME_REFERENCE_RE, (_reference, hex?: string, decimal?: string, name?: string) => {\n if (name) return name.toLowerCase() === 'colon' ? ':' : '\\n';\n const code = hex ? Number.parseInt(hex, 16) : Number(decimal);\n return code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : '\\ufffd';\n });\n}\n\n/**\n * A URL safe to put in a link's `href` or an image's `src`, or `null` where the\n * editor refuses it — the one URL policy behind the link panel, a paste and a\n * bound value.\n *\n * A refusal is never rewritten into something else. Angular's answer to a\n * hostile URL is the string `unsafe:javascript:…` in a live anchor — a link that\n * looks real, is announced as a link, and does nothing — so a pasted link keeps\n * its text and loses the URL instead, the panel says the address cannot be used,\n * and a bound value holding one is refused whole.\n *\n * Whitespace and control characters are stripped before the scheme is read,\n * because `java\\nscript:` and `java script:` are the same URL to a browser and\n * different strings to a naive check. So are character references:\n * `javascript:` has no scheme to this check, and the editor's own drawing\n * never decodes it — but a stored value is read again by whatever renders it\n * next, and an HTML attribute or a markdown destination hands a browser\n * `javascript:`. The scheme is read from the decoded form; what comes back is\n * still the URL as written.\n */\nfunction safeUrl(raw: string, kind: 'link' | 'image'): string | null {\n const url = raw.trim();\n const bare = url.replace(URL_IGNORED_RE, '');\n const scheme = SCHEME_RE.exec(decodeSchemeReferences(bare).replace(URL_IGNORED_RE, ''));\n\n // No scheme at all: relative path, `#anchor`, `//host` — nothing executable.\n if (!scheme) return url;\n\n const name = scheme[1].toLowerCase();\n\n // `data:` is an image-only allowance, and only for raster types: an SVG can\n // carry script, and `data:text/html` is a same-origin document.\n if (name === 'data') return kind === 'image' && DATA_IMAGE_RE.test(bare) ? bare : null;\n\n return ALLOWED_SCHEMES.has(name) ? url : null;\n}\n\nexport { safeUrl };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type MarkSpec, type Node, type NodeSpec, Schema } from 'prosemirror-model';\n\nimport { safeUrl } from './safe-url';\n\n/**\n * How deep blockquotes and list items may nest through editing. Each quote and\n * each list item is one level.\n *\n * Some limit has to exist, because the editor must read back what it writes: a\n * bound value nesting past `MAX_JSON_DEPTH` is refused unread, so a Mod-] held\n * down long enough would otherwise store a document the next load refuses.\n * Eleven is deeper than any outline anyone writes and far inside that bound.\n */\nconst MAX_NESTING = 11;\n\n/** The `align` values a table cell may carry. */\nconst ALIGNS: ReadonlySet<unknown> = new Set([null, 'start', 'center', 'end']);\n\n/** The largest list start: nine digits, the most the `1. ` input rule reads. */\nconst MAX_ORDER = 999999999;\n\n/**\n * The URL policy as a schema rule.\n *\n * A paste asks it in `getAttrs`, where a refusal drops the link and keeps its\n * text. A bound value — plus every attribute ProseMirror validates since view\n * 1.42.3, clipboard slice context included — hits these validators, which THROW:\n * a value holding a refused URL is refused as a whole, the same as one holding\n * an unknown node.\n */\nfunction requireUrl(kind: 'link' | 'image') {\n return (value: unknown): void => {\n if (typeof value !== 'string' || safeUrl(value, kind) !== value) {\n throw new RangeError(`<wr-editor>: refused ${kind} URL`);\n }\n };\n}\n\nfunction nullableString(value: unknown): void {\n if (value !== null && typeof value !== 'string') throw new RangeError('<wr-editor>: expected a string or null');\n}\n\n/**\n * The attributes of an `<a>` a pasted document may keep: the href, and only when\n * the policy allows it. `false` drops the mark and keeps the text — which is why\n * this refuses rather than rewrites.\n */\nfunction linkAttrs(dom: HTMLElement): false | { href: string; title: string | null } {\n const href = safeUrl(dom.getAttribute('href') ?? '', 'link');\n return href ? { href, title: dom.getAttribute('title') } : false;\n}\n\nfunction imageAttrs(dom: HTMLElement): false | { src: string; alt: string; title: string | null } {\n const src = safeUrl(dom.getAttribute('src') ?? '', 'image');\n return src ? { src, alt: dom.getAttribute('alt') ?? '', title: dom.getAttribute('title') } : false;\n}\n\n/**\n * A list item's task state, from this schema's own `data-checked` or from the\n * `<input type=\"checkbox\">` GitHub-style renderers put first in the item.\n */\nfunction checkedOf(dom: HTMLElement): boolean | null {\n const data = dom.getAttribute('data-checked');\n if (data === 'true' || data === 'false') return data === 'true';\n for (let child = dom.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === 3 && !(child.textContent ?? '').trim()) continue;\n if (child.nodeName !== 'INPUT') return null;\n const input = child as HTMLInputElement;\n return (input.getAttribute('type') ?? '').toLowerCase() === 'checkbox' ? input.hasAttribute('checked') : null;\n }\n return null;\n}\n\nfunction alignOf(dom: HTMLElement): 'start' | 'center' | 'end' | null {\n // The first one that says anything: an element with no inline style reports\n // `''` for it, not null, so a nullish fallback would stop there.\n const raw = [dom.getAttribute('data-align'), dom.style?.textAlign, dom.getAttribute('align')].find(Boolean) ?? '';\n const word = raw.toLowerCase();\n if (word === 'center') return 'center';\n if (word === 'start' || word === 'left') return 'start';\n if (word === 'end' || word === 'right') return 'end';\n return null;\n}\n\n/**\n * A code block's language: the first word, lowercased, and nothing past 64\n * characters — or `null`. It becomes a class name and a data attribute, so the\n * one rule for it on every path in is that nothing can break out of a word.\n */\nfunction languageValue(raw: string | null): string | null {\n const word = (raw ?? '').trim().split(/\\s+/)[0].toLowerCase();\n return word && word.length <= 64 ? word : null;\n}\n\nfunction languageOf(dom: HTMLElement): string | null {\n const code = dom.querySelector('code');\n const named = dom.getAttribute('data-language') ?? code?.getAttribute('data-language');\n const fromClass = /(?:^|\\s)language-(\\S+)/.exec(code?.getAttribute('class') ?? '')?.[1];\n return languageValue(named ?? fromClass ?? null);\n}\n\nfunction orderOf(dom: HTMLElement): number {\n const start = Number.parseInt(dom.getAttribute('start') ?? '', 10);\n return Number.isFinite(start) ? Math.min(Math.max(start, 0), MAX_ORDER) : 1;\n}\n\nconst nodes: Record<string, NodeSpec> = {\n doc: { content: 'block+' },\n\n paragraph: {\n group: 'block',\n content: 'inline*',\n parseDOM: [{ tag: 'p' }],\n toDOM: () => ['p', 0],\n },\n\n heading: {\n group: 'block',\n content: 'inline*',\n defining: true,\n attrs: {\n level: {\n default: 1,\n // A FUNCTION, not `'number'`: the level becomes a tag name in `toDOM`,\n // and a type check alone accepts `{ level: 9 }`.\n validate: (value: unknown) => {\n if (value !== 1 && value !== 2 && value !== 3) throw new RangeError('<wr-editor>: heading level is 1–3');\n },\n },\n },\n // h4–h6 clamp to h3 rather than falling through to a paragraph, which would\n // lose the fact that the line was a heading at all.\n parseDOM: [\n { tag: 'h1', attrs: { level: 1 } },\n { tag: 'h2', attrs: { level: 2 } },\n { tag: 'h3', attrs: { level: 3 } },\n { tag: 'h4', attrs: { level: 3 } },\n { tag: 'h5', attrs: { level: 3 } },\n { tag: 'h6', attrs: { level: 3 } },\n ],\n toDOM: node => [`h${Math.min(Math.max(Number(node.attrs['level']) || 1, 1), 3)}`, 0],\n },\n\n blockquote: {\n group: 'block',\n content: 'block+',\n defining: true,\n parseDOM: [{ tag: 'blockquote' }],\n toDOM: () => ['blockquote', 0],\n },\n\n code_block: {\n group: 'block',\n content: 'text*',\n marks: '',\n code: true,\n defining: true,\n attrs: {\n language: {\n default: null,\n validate: (value: unknown) => {\n if (value !== null && (typeof value !== 'string' || languageValue(value) !== value)) {\n throw new RangeError('<wr-editor>: a code language is one lowercase word');\n }\n },\n },\n },\n parseDOM: [{ tag: 'pre', preserveWhitespace: 'full', getAttrs: dom => ({ language: languageOf(dom) }) }],\n toDOM: node => {\n const language = node.attrs['language'] as string | null;\n return ['pre', ['code', language ? { class: `language-${language}`, 'data-language': language } : {}, 0]];\n },\n },\n\n horizontal_rule: {\n group: 'block',\n parseDOM: [{ tag: 'hr' }],\n toDOM: () => ['hr'],\n },\n\n bullet_list: {\n group: 'block',\n content: 'list_item+',\n attrs: { tight: { default: true, validate: 'boolean' } },\n parseDOM: [{ tag: 'ul' }],\n toDOM: () => ['ul', 0],\n },\n\n ordered_list: {\n group: 'block',\n content: 'list_item+',\n attrs: {\n order: {\n default: 1,\n validate: (value: unknown) => {\n if (!Number.isInteger(value) || (value as number) < 0 || (value as number) > MAX_ORDER) {\n throw new RangeError('<wr-editor>: a list starts at a whole number');\n }\n },\n },\n tight: { default: true, validate: 'boolean' },\n },\n parseDOM: [{ tag: 'ol', getAttrs: dom => ({ order: orderOf(dom) }) }],\n toDOM: node => (node.attrs['order'] === 1 ? ['ol', 0] : ['ol', { start: String(node.attrs['order']) }, 0]),\n },\n\n list_item: {\n content: 'paragraph block*',\n defining: true,\n attrs: {\n checked: {\n default: null,\n validate: (value: unknown) => {\n if (value !== null && typeof value !== 'boolean') throw new RangeError('<wr-editor>: checked is a boolean');\n },\n },\n },\n parseDOM: [{ tag: 'li', getAttrs: dom => ({ checked: checkedOf(dom) }) }],\n toDOM: node => {\n const checked = node.attrs['checked'] as boolean | null;\n return checked === null ? ['li', 0] : ['li', { 'data-checked': String(checked) }, 0];\n },\n },\n\n table: {\n group: 'block',\n content: 'table_row+',\n isolating: true,\n parseDOM: [{ tag: 'table' }],\n toDOM: () => ['table', ['tbody', 0]],\n },\n\n table_row: {\n content: '(table_header | table_cell)+',\n parseDOM: [{ tag: 'tr' }],\n toDOM: () => ['tr', 0],\n },\n\n table_header: cell('th'),\n table_cell: cell('td'),\n\n text: { group: 'inline' },\n\n image: {\n group: 'inline',\n inline: true,\n draggable: true,\n attrs: {\n src: { validate: requireUrl('image') },\n alt: { default: '', validate: 'string' },\n title: { default: null, validate: nullableString },\n },\n parseDOM: [{ tag: 'img[src]', getAttrs: imageAttrs }],\n toDOM: node => {\n // Re-asked here: validators do not run on `type.create()`, so a node built\n // in code never passed through them.\n const src = safeUrl(String(node.attrs['src'] ?? ''), 'image');\n const title = node.attrs['title'] as string | null;\n return ['img', { src: src ?? '', alt: String(node.attrs['alt'] ?? ''), ...(title ? { title } : {}) }];\n },\n },\n\n hard_break: {\n group: 'inline',\n inline: true,\n selectable: false,\n linebreakReplacement: true,\n parseDOM: [{ tag: 'br' }],\n toDOM: () => ['br'],\n },\n};\n\nfunction cell(tag: 'th' | 'td'): NodeSpec {\n return {\n content: 'paragraph+',\n isolating: true,\n attrs: {\n align: {\n default: null,\n validate: (value: unknown) => {\n if (!ALIGNS.has(value)) throw new RangeError('<wr-editor>: align is start, center or end');\n },\n },\n },\n parseDOM: [{ tag, getAttrs: dom => ({ align: alignOf(dom) }) }],\n // The value is one of three words — checked by the validator, and again\n // here — so writing it into `style` cannot carry anything the input chose.\n toDOM: node => {\n const align = node.attrs['align'] as string | null;\n return ALIGNS.has(align) && align ? [tag, { style: `text-align: ${align}` }, 0] : [tag, 0];\n },\n };\n}\n\n/**\n * Marks in nesting order, outermost first — which is also how `toDOM` nests\n * them, on the surface and in the HTML a copy puts on the clipboard.\n */\nconst marks: Record<string, MarkSpec> = {\n link: {\n inclusive: false,\n attrs: {\n href: { validate: requireUrl('link') },\n title: { default: null, validate: nullableString },\n },\n parseDOM: [{ tag: 'a[href]', getAttrs: linkAttrs }],\n toDOM: mark => {\n const href = safeUrl(String(mark.attrs['href'] ?? ''), 'link');\n if (!href) return ['span', 0];\n const title = mark.attrs['title'] as string | null;\n return ['a', { href, ...(title ? { title } : {}), rel: 'noopener noreferrer nofollow' }, 0];\n },\n },\n strong: {\n parseDOM: [\n { tag: 'strong' },\n // Google Docs wraps a whole paste in `<b style=\"font-weight: normal\">`.\n { tag: 'b', getAttrs: dom => dom.style.fontWeight !== 'normal' && null },\n { style: 'font-weight=400', clearMark: mark => mark.type.name === 'strong' },\n { style: 'font-weight', getAttrs: value => /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null },\n ],\n toDOM: () => ['strong', 0],\n },\n em: {\n parseDOM: [\n { tag: 'i' },\n { tag: 'em' },\n { style: 'font-style=italic' },\n { style: 'font-style=normal', clearMark: mark => mark.type.name === 'em' },\n ],\n toDOM: () => ['em', 0],\n },\n underline: {\n parseDOM: [{ tag: 'u' }, { style: 'text-decoration=underline' }, { style: 'text-decoration-line=underline' }],\n toDOM: () => ['u', 0],\n },\n strike: {\n parseDOM: [\n { tag: 's' },\n { tag: 'del' },\n { tag: 'strike' },\n { style: 'text-decoration=line-through' },\n { style: 'text-decoration-line=line-through' },\n ],\n toDOM: () => ['s', 0],\n },\n code: {\n code: true,\n parseDOM: [{ tag: 'code' }],\n toDOM: () => ['code', 0],\n },\n};\n\nlet schema: Schema | null = null;\n\n/** The editor's schema, built on first use and shared after that. */\nfunction editorSchema(): Schema {\n return (schema ??= new Schema({ nodes, marks }));\n}\n\n/** How many blockquotes and list items deep the document's deepest block sits. */\nfunction nestingOf(doc: Node): number {\n let deepest = 0;\n const walk = (node: Node, depth: number): void => {\n node.forEach(child => {\n if (child.isTextblock || child.isLeaf) return;\n const next = child.type.name === 'blockquote' || child.type.name === 'list_item' ? depth + 1 : depth;\n if (next > deepest) deepest = next;\n walk(child, next);\n });\n };\n walk(doc, 0);\n return deepest;\n}\n\n/**\n * A document that is one empty textblock — the shape the placeholder is drawn\n * on. Which textblock is open: an empty heading shows the hint as well.\n *\n * Not the test for \"nothing written\"; that is {@link isBlankDoc}.\n */\nfunction isEmptyDoc(doc: Node): boolean {\n if (doc.childCount !== 1) return false;\n const only = doc.firstChild!;\n return only.isTextblock && only.childCount === 0;\n}\n\n/**\n * A document with nothing written in it: no text but whitespace, and no leaf\n * but line breaks. An image or a rule is content in its own right; structure\n * alone is not.\n *\n * Decided by content rather than by shape, because every one of these looks\n * empty: Enter on an empty editor (two empty paragraphs), a lone Shift-Enter, a\n * few spaces, and a list, a quote or a heading chosen on an empty editor. Written\n * as anything but `null`, `required()` passes over an editor with nothing in it.\n */\nfunction isBlankDoc(doc: Node): boolean {\n let written = false;\n doc.descendants(node => {\n if (node.isText ? /\\S/.test(node.text!) : node.isLeaf && node.type.name !== 'hard_break') written = true;\n return !written;\n });\n return !written;\n}\n\nexport { MAX_NESTING, editorSchema, nestingOf, isEmptyDoc, isBlankDoc };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Node, Schema } from 'prosemirror-model';\n\nimport type { WrEditorJson, WrEditorValue } from '../types';\n\nimport { readJson } from './json';\nimport { isBlankDoc } from './schema';\n\n/**\n * A bound value as a document in `schema`, or a thrown error naming why it was\n * refused. `null` and `undefined` are the empty document.\n *\n * Throwing is the whole contract: the caller keeps the document it already has,\n * which is the rule `wr-input-number` and `wr-date-picker` follow for input they\n * cannot read. Nothing here ever returns a \"repaired\" document to write back.\n */\nexport function readValue(value: WrEditorValue | undefined, schema: Schema): Node {\n if (value === null || value === undefined) return schema.topNodeType.createAndFill()!;\n // Named on its own, since it is the one likely mistake: a tree stored as a JSON\n // string and bound without parsing it, or an HTML or markdown string.\n if (typeof value === 'string') throw new RangeError('<wr-editor>: the value is a JSON tree, not a string');\n return readJson(value, schema);\n}\n\n/** The document as a value — `null` when nothing is written in it: see {@link isBlankDoc}. */\nexport function writeValue(doc: Node): WrEditorValue {\n return isBlankDoc(doc) ? null : (doc.toJSON() as WrEditorJson);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { baseKeymap, chainCommands, exitCode, setBlockType, toggleMark, wrapIn } from 'prosemirror-commands';\nimport { history, redo, undo } from 'prosemirror-history';\nimport { inputRules, textblockTypeInputRule, undoInputRule, wrappingInputRule } from 'prosemirror-inputrules';\nimport { keymap } from 'prosemirror-keymap';\nimport type { Mark, MarkType, NodeType, ResolvedPos, Schema } from 'prosemirror-model';\nimport { liftListItem, sinkListItem, splitListItem, wrapInList } from 'prosemirror-schema-list';\nimport { type Command, type EditorState, Plugin, TextSelection, type Transaction } from 'prosemirror-state';\n\nimport type { WrEditorTool } from '../types';\n\nimport { MAX_NESTING, nestingOf } from './schema';\n\n/** Every tool but the separator. */\ntype WrEditorCommandTool = Exclude<WrEditorTool, '|'>;\n\n/** A shortcut, always on the platform's primary modifier (⌘ on Apple, Ctrl elsewhere). */\ninterface WrEditorShortcut {\n readonly key: string;\n readonly shift?: boolean;\n readonly alt?: boolean;\n}\n\n/**\n * The keyboard half of each tool — the keymap below binds exactly these, so a\n * hint can never name a shortcut that does nothing.\n *\n * Where a convention exists it is followed: Google Docs for the block types\n * (Mod-Alt-0…3, Mod-Shift-7/8), and Tiptap / Notion for the three it does not\n * cover (Mod-Shift-S strikethrough, Mod-E inline code, Mod-Shift-B quote,\n * Mod-Alt-C code block). The horizontal rule has none. Tab is deliberately not\n * bound — indenting with it would be a keyboard trap (WCAG 2.1.2), so list items\n * move with Mod-] and Mod-[ — and neither is Escape, which `<wr-dialog>` needs.\n *\n * Where a layout types `[` and `]` with AltGr or Option (German, French, the\n * Nordic and Polish layouts), the bracket chords are also read with that Alt\n * held — see {@link bracketKeys} — since nothing else indents a list item. The\n * Mod-Alt chords are NOT widened the same way: on Windows, Ctrl+Alt is AltGr, and\n * on those layouts AltGr+0 types `}` and AltGr+C types `ć`. Taking the chord by\n * physical key would make those characters impossible to type in the editor, so\n * there the key types its character and the toolbar sets the block type.\n */\nconst SHORTCUTS: Readonly<Partial<Record<WrEditorCommandTool, WrEditorShortcut>>> = {\n bold: { key: 'B' },\n italic: { key: 'I' },\n underline: { key: 'U' },\n strike: { key: 'S', shift: true },\n code: { key: 'E' },\n paragraph: { key: '0', alt: true },\n heading1: { key: '1', alt: true },\n heading2: { key: '2', alt: true },\n heading3: { key: '3', alt: true },\n bulletList: { key: '8', shift: true },\n orderedList: { key: '7', shift: true },\n blockquote: { key: 'B', shift: true },\n codeBlock: { key: 'C', alt: true },\n link: { key: 'K' },\n undo: { key: 'Z' },\n redo: { key: 'Z', shift: true },\n};\n\n/**\n * The tools a click toggles — the ones that carry `aria-pressed`. Not `link`,\n * which opens a panel: a popup button that also claimed to be pressed would say\n * two contradictory things.\n */\nconst TOGGLES: ReadonlySet<WrEditorCommandTool> = new Set<WrEditorCommandTool>([\n 'bold',\n 'italic',\n 'underline',\n 'strike',\n 'code',\n 'paragraph',\n 'heading1',\n 'heading2',\n 'heading3',\n 'bulletList',\n 'orderedList',\n 'blockquote',\n 'codeBlock',\n]);\n\n// ---------------------------------------------------------------------------\n// State\n// ---------------------------------------------------------------------------\n\nfunction markActive(state: EditorState, type: MarkType): boolean {\n const { empty, from, to, $from } = state.selection;\n if (empty) return !!type.isInSet(state.storedMarks ?? $from.marks());\n return state.doc.rangeHasMark(from, to, type);\n}\n\n/**\n * Whether every textblock the selection touches is `type` — asked of the blocks\n * themselves rather than of `$from.parent`, which is the DOCUMENT under a\n * select-all.\n */\nfunction parentIs(state: EditorState, type: NodeType, attrs?: Record<string, unknown>): boolean {\n const { empty, from, to, $from } = state.selection;\n if (empty) return $from.parent.hasMarkup(type, attrs);\n let found = false;\n let all = true;\n state.doc.nodesBetween(from, to, node => {\n if (!node.isTextblock) return true;\n found = true;\n if (!node.hasMarkup(type, attrs)) all = false;\n return false;\n });\n return found && all;\n}\n\n/** The nearest list around the selection, with the position it starts at. */\nfunction nearestList(state: EditorState): { readonly type: NodeType; readonly pos: number } | null {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth--) {\n const node = $from.node(depth);\n if (node.type.name === 'bullet_list' || node.type.name === 'ordered_list') {\n return { type: node.type, pos: $from.before(depth) };\n }\n }\n return null;\n}\n\nfunction insideNode(state: EditorState, type: NodeType): boolean {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth--) if ($from.node(depth).type === type) return true;\n return false;\n}\n\n/** Whether a tool's state is \"on\" at the selection — what `aria-pressed` reports. */\nfunction toolActive(tool: WrEditorCommandTool, state: EditorState): boolean {\n const { marks, nodes } = state.schema;\n switch (tool) {\n case 'bold':\n return markActive(state, marks['strong']);\n case 'italic':\n return markActive(state, marks['em']);\n case 'underline':\n return markActive(state, marks['underline']);\n case 'strike':\n return markActive(state, marks['strike']);\n case 'code':\n return markActive(state, marks['code']);\n case 'link':\n return linkRange(state) !== null;\n case 'paragraph':\n return parentIs(state, nodes['paragraph']);\n case 'heading1':\n return parentIs(state, nodes['heading'], { level: 1 });\n case 'heading2':\n return parentIs(state, nodes['heading'], { level: 2 });\n case 'heading3':\n return parentIs(state, nodes['heading'], { level: 3 });\n case 'codeBlock':\n return parentIs(state, nodes['code_block']);\n case 'bulletList':\n return nearestList(state)?.type === nodes['bullet_list'];\n case 'orderedList':\n return nearestList(state)?.type === nodes['ordered_list'];\n case 'blockquote':\n return insideNode(state, nodes['blockquote']);\n default:\n return false;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Commands\n// ---------------------------------------------------------------------------\n\n/** What a tool does. */\nfunction toolCommand(tool: WrEditorCommandTool, schema: Schema): Command {\n const { marks, nodes } = schema;\n const heading = (level: 1 | 2 | 3): Command => toggleBlock(nodes['heading'], nodes['paragraph'], { level });\n\n switch (tool) {\n case 'bold':\n return toggleMark(marks['strong']);\n case 'italic':\n return toggleMark(marks['em']);\n case 'underline':\n return toggleMark(marks['underline']);\n case 'strike':\n return toggleMark(marks['strike']);\n case 'code':\n return toggleMark(marks['code']);\n // The link tool opens a panel; `setLink` is its command.\n case 'link':\n return toggleMark(marks['link'], { href: '#' });\n case 'paragraph':\n return setBlockType(nodes['paragraph']);\n case 'heading1':\n return heading(1);\n case 'heading2':\n return heading(2);\n case 'heading3':\n return heading(3);\n case 'codeBlock':\n return toggleBlock(nodes['code_block'], nodes['paragraph']);\n case 'bulletList':\n return toggleList(nodes['bullet_list'], nodes['list_item']);\n case 'orderedList':\n return toggleList(nodes['ordered_list'], nodes['list_item']);\n case 'blockquote':\n return toggleQuote(nodes['blockquote']);\n case 'horizontalRule':\n return insertRule(nodes['horizontal_rule']);\n case 'undo':\n return undo;\n case 'redo':\n return redo;\n }\n}\n\n/** A block type that switches back to a paragraph when it is already on. */\nfunction toggleBlock(type: NodeType, paragraph: NodeType, attrs?: Record<string, unknown>): Command {\n return (state, dispatch) =>\n parentIs(state, type, attrs)\n ? setBlockType(paragraph)(state, dispatch)\n : setBlockType(type, attrs)(state, dispatch);\n}\n\n/**\n * A list toggle: out of this kind of list, over to it from the other kind, or\n * into a new one.\n */\nfunction toggleList(type: NodeType, item: NodeType): Command {\n return (state, dispatch) => {\n const list = nearestList(state);\n if (!list) return wrapInList(type)(state, dispatch);\n if (list.type === type) return liftListItem(item)(state, dispatch);\n if (dispatch) {\n const tight = state.doc.nodeAt(list.pos)?.attrs['tight'] !== false;\n const attrs = type.name === 'ordered_list' ? { order: 1, tight } : { tight };\n dispatch(state.tr.setNodeMarkup(list.pos, type, attrs).scrollIntoView());\n }\n return true;\n };\n}\n\n/**\n * Into a quote, or out of the nearest one.\n *\n * Out is a hand-rolled lift rather than `prosemirror-commands`' `lift`, which\n * lifts out of whatever the selection's parent is — inside a quoted list that is\n * the list item, not the quote. The target depth is the quote's own parent; a\n * lift that does not fit there throws, and the throw is the \"cannot\".\n */\nfunction toggleQuote(quote: NodeType): Command {\n return (state, dispatch) => {\n const { $from, $to } = state.selection;\n const range = insideNode(state, quote) ? $from.blockRange($to, node => node.type === quote) : null;\n if (!range) return wrapIn(quote)(state, dispatch);\n try {\n const tr = state.tr.lift(range, range.depth - 1);\n if (dispatch) dispatch(tr.scrollIntoView());\n return true;\n } catch {\n return false;\n }\n };\n}\n\n/**\n * A horizontal rule at the selection, where one fits without leaving an\n * isolating node — a table cell holds paragraphs only, and splitting the table\n * around a rule is not what anyone clicking the button meant.\n */\nfunction insertRule(rule: NodeType): Command {\n return (state, dispatch) => {\n const { $from } = state.selection;\n let fits = false;\n for (let depth = $from.depth; depth >= 0; depth--) {\n const node = $from.node(depth);\n const index = $from.index(depth);\n if (node.canReplaceWith(index, index, rule)) {\n fits = true;\n break;\n }\n if (node.type.spec.isolating) break;\n }\n if (!fits) return false;\n if (dispatch) dispatch(state.tr.replaceSelectionWith(rule.create()).scrollIntoView());\n return true;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Tables\n// ---------------------------------------------------------------------------\n\n/** The table around the selection, as a depth of `$from`, or `-1`. */\nfunction tableDepth(state: EditorState): number {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth--) if ($from.node(depth).type.name === 'table') return depth;\n return -1;\n}\n\n/**\n * An empty paragraph beside the table at `depth`, with the caret in it — the one\n * way to a line the keyboard cannot otherwise reach. There is no gap cursor here,\n * and a cell holds paragraphs, so Enter only ever splits inside it.\n */\nfunction paragraphBeside(\n state: EditorState,\n depth: number,\n side: 'before' | 'after',\n dispatch?: (tr: Transaction) => void\n): boolean {\n const { $from } = state.selection;\n const paragraph = state.schema.nodes['paragraph'];\n const parent = $from.node(depth - 1);\n const index = $from.index(depth - 1) + (side === 'after' ? 1 : 0);\n if (!parent.canReplaceWith(index, index, paragraph)) return false;\n if (dispatch) {\n const pos = side === 'after' ? $from.after(depth) : $from.before(depth);\n const tr = state.tr.insert(pos, paragraph.create());\n dispatch(tr.setSelection(TextSelection.create(tr.doc, pos + 1)).scrollIntoView());\n }\n return true;\n}\n\n/** Mod-Enter in a table: out of it, onto a new line below — what `exitCode` does for a code block. */\nconst exitTable: Command = (state, dispatch) => {\n const depth = tableDepth(state);\n return depth > 0 && paragraphBeside(state, depth, 'after', dispatch);\n};\n\n/**\n * The arrow key off the edge of a table nothing can be reached past: ArrowDown on\n * the last line of its last row with no text anywhere after it, ArrowUp on the\n * first line of its first row with none before. Anywhere else the key moves the\n * caret as it always does. Up and down only — left and right swap ends under\n * `dir=\"rtl\"`, and the vertical pair means the same thing in both directions.\n */\nfunction leaveTable(side: 'before' | 'after'): Command {\n return (state, dispatch, view) => {\n if (view && !view.editable) return false;\n const depth = tableDepth(state);\n const { $from, empty } = state.selection;\n if (depth < 0 || !empty) return false;\n // table > row > cell > paragraph: the row's place in the table, and the\n // paragraph's in its cell.\n const table = $from.node(depth);\n const cell = $from.node(depth + 2);\n const row = $from.index(depth);\n const block = $from.index(depth + 2);\n const edge =\n side === 'after' ? row === table.childCount - 1 && block === cell.childCount - 1 : row === 0 && block === 0;\n if (!edge) return false;\n const onEdgeLine = view\n ? view.endOfTextblock(side === 'after' ? 'down' : 'up')\n : $from.parentOffset === (side === 'after' ? $from.parent.content.size : 0);\n if (!onEdgeLine) return false;\n const outside = state.doc.resolve(side === 'after' ? $from.after(depth) : $from.before(depth));\n if (TextSelection.findFrom(outside, side === 'after' ? 1 : -1, true)) return false;\n return paragraphBeside(state, depth, side, dispatch);\n };\n}\n\nfunction insertHardBreak(state: EditorState, dispatch?: (tr: Transaction) => void): boolean {\n const type = state.schema.nodes['hard_break'];\n const { $from } = state.selection;\n if (!$from.parent.canReplaceWith($from.index(), $from.index(), type)) return false;\n if (dispatch) dispatch(state.tr.replaceSelectionWith(type.create()).scrollIntoView());\n return true;\n}\n\n// ---------------------------------------------------------------------------\n// Links\n// ---------------------------------------------------------------------------\n\n/**\n * The run of text carrying one link around the selection — the whole link, when\n * the caret merely sits in it — or `null` when there is none.\n */\nfunction linkRange(state: EditorState): { readonly from: number; readonly to: number; readonly mark: Mark } | null {\n const type = state.schema.marks['link'];\n const { empty, from, to, $from } = state.selection;\n if (!empty) {\n let found: Mark | null = null;\n state.doc.nodesBetween(from, to, node => {\n found ??= type.isInSet(node.marks) ?? null;\n });\n return found ? { from, to, mark: found } : null;\n }\n return markAround($from, type);\n}\n\nfunction markAround($pos: ResolvedPos, type: MarkType): { from: number; to: number; mark: Mark } | null {\n const parent = $pos.parent;\n const start = $pos.start();\n const offsets: number[] = [];\n parent.forEach((_child, offset) => offsets.push(offset));\n\n // The child the caret is in — or, at a boundary, the one before it and then\n // the one after, since a non-inclusive mark does not report itself at its end.\n const index = $pos.index();\n const candidates = ($pos.textOffset > 0 ? [index] : [index - 1, index]).filter(i => i >= 0 && i < parent.childCount);\n for (const at of candidates) {\n const mark = type.isInSet(parent.child(at).marks);\n if (!mark) continue;\n let first = at;\n let last = at;\n while (first > 0 && mark.isInSet(parent.child(first - 1).marks)) first--;\n while (last < parent.childCount - 1 && mark.isInSet(parent.child(last + 1).marks)) last++;\n return { from: start + offsets[first], to: start + offsets[last] + parent.child(last).nodeSize, mark };\n }\n return null;\n}\n\n/**\n * Link the selection to `href` — replacing the link it sits in when the caret\n * is inside one, and inserting the address as its own text when nothing is\n * selected at all. `href` has already passed the URL policy.\n */\nfunction setLink(href: string): Command {\n return (state, dispatch) => {\n const type = state.schema.marks['link'];\n const { empty, from, to } = state.selection;\n const existing = linkRange(state);\n const title = (existing?.mark.attrs['title'] as string | null | undefined) ?? null;\n const mark = type.create({ href, title });\n if (!toggleMark(type, { href })(state)) return false;\n if (!dispatch) return true;\n\n const tr = state.tr;\n if (!empty) tr.removeMark(from, to, type).addMark(from, to, mark);\n else if (existing) tr.removeMark(existing.from, existing.to, type).addMark(existing.from, existing.to, mark);\n else tr.insertText(href, from).addMark(from, from + href.length, mark);\n dispatch(tr.scrollIntoView());\n return true;\n };\n}\n\n/** Remove the link the selection is in or covers. */\nconst removeLink: Command = (state, dispatch) => {\n const range = linkRange(state);\n if (!range) return false;\n if (dispatch) dispatch(state.tr.removeMark(range.from, range.to, state.schema.marks['link']).scrollIntoView());\n return true;\n};\n\n// ---------------------------------------------------------------------------\n// Plugins\n// ---------------------------------------------------------------------------\n\n/**\n * The editor's plugin stack, in precedence order: its own keys, history keys,\n * ProseMirror's base keymap, then history and the markdown-style input rules.\n *\n * `canEdit` is asked for every document-changing transaction, because\n * `view.dispatch()` does not consult `editable` — a toolbar click or a plugin\n * would otherwise change a read-only document. Outside writes never pass here:\n * they replace the state wholesale.\n *\n * The input rules are the block shortcuts only. The typographic ones (smart\n * quotes, the em dash, the ellipsis) are left out on purpose: in a form control\n * they silently rewrite what someone typed into a name, a code or a reference.\n */\nfunction editorPlugins(\n schema: Schema,\n options: { readonly apple: boolean; readonly canEdit: () => boolean }\n): Plugin[] {\n const { nodes } = schema;\n const keys: Record<string, Command> = {};\n const bind = (combo: string, command: Command): void => {\n keys[combo] = command;\n // `event.key` is upper case under Shift or Caps Lock, and ProseMirror\n // matches on it; bound twice, the way `prosemirror-example-setup` does.\n const last = combo.slice(combo.lastIndexOf('-') + 1);\n if (/^[a-z]$/.test(last)) keys[combo.slice(0, -1) + last.toUpperCase()] = command;\n };\n\n for (const [tool, shortcut] of Object.entries(SHORTCUTS) as [WrEditorCommandTool, WrEditorShortcut][]) {\n if (tool === 'link' || tool === 'undo' || tool === 'redo') continue;\n bind(comboOf(shortcut), toolCommand(tool, schema));\n }\n bind('Mod-z', undo);\n bind('Mod-Shift-z', redo);\n if (!options.apple) bind('Mod-y', redo);\n keys['Shift-Enter'] = chainCommands(exitCode, insertHardBreak);\n keys['Mod-Enter'] = chainCommands(exitCode, exitTable);\n keys['Enter'] = splitListItem(nodes['list_item']);\n keys['Mod-['] = liftListItem(nodes['list_item']);\n keys['Mod-]'] = sinkListItem(nodes['list_item']);\n keys['ArrowDown'] = leaveTable('after');\n keys['ArrowUp'] = leaveTable('before');\n keys['Backspace'] = undoInputRule;\n\n return [\n new Plugin({\n filterTransaction: (tr, state) => {\n if (!tr.docChanged) return true;\n if (!options.canEdit()) return false;\n // `MAX_NESTING` is the deepest an edit may take a document. One that\n // already nests deeper (a bound value) is kept as it is; what is refused\n // is an edit that makes it deeper still.\n const depth = nestingOf(tr.doc);\n return depth <= MAX_NESTING || depth <= nestingOf(state.doc);\n },\n }),\n bracketKeys(nodes['list_item'], options.apple),\n keymap(keys),\n keymap(baseKeymap),\n history(),\n inputRules({\n rules: [\n textblockTypeInputRule(/^(#{1,3})\\s$/, nodes['heading'], match => ({ level: match[1].length })),\n wrappingInputRule(/^\\s*>\\s$/, nodes['blockquote']),\n wrappingInputRule(/^\\s*([-+*])\\s$/, nodes['bullet_list']),\n wrappingInputRule(\n /^(\\d{1,9})\\.\\s$/,\n nodes['ordered_list'],\n match => ({ order: Number(match[1]) }),\n (match, node) => node.childCount + (node.attrs['order'] as number) === Number(match[1])\n ),\n textblockTypeInputRule(/^```$/, nodes['code_block']),\n ],\n }),\n ];\n}\n\n/**\n * Mod-] and Mod-[ as they are TYPED on a layout that needs AltGr or Option for a\n * bracket: Windows German reports AltGr+8 as Ctrl+Alt with `key` `[`, macOS\n * German reports Option+5 under ⌘ as ⌘+Alt with `key` `[`. The keymap matches on\n * the full modifier set, so neither reaches `Mod-[`, and indenting a list item has\n * no other path — Tab is not bound and the toolbar has no indent tool.\n *\n * Matched on the character, never on `event.code`: the physical key at `]` is `+`\n * on a German keyboard, and Ctrl and `+` is the browser's zoom.\n */\nfunction bracketKeys(item: NodeType, apple: boolean): Plugin {\n const lift = liftListItem(item);\n const sink = sinkListItem(item);\n return new Plugin({\n props: {\n handleKeyDown: (view, event) => {\n if (!event.altKey || event.shiftKey || (event.key !== '[' && event.key !== ']')) return false;\n const mod = apple ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;\n return mod && (event.key === ']' ? sink : lift)(view.state, view.dispatch);\n },\n },\n });\n}\n\n/** A shortcut in ProseMirror's key-name syntax. */\nfunction comboOf(shortcut: WrEditorShortcut): string {\n return `Mod-${shortcut.alt ? 'Alt-' : ''}${shortcut.shift ? 'Shift-' : ''}${shortcut.key.toLowerCase()}`;\n}\n\nexport {\n SHORTCUTS,\n TOGGLES,\n toolActive,\n toolCommand,\n linkRange,\n setLink,\n removeLink,\n exitTable,\n leaveTable,\n editorPlugins,\n comboOf,\n};\nexport type { WrEditorCommandTool, WrEditorShortcut };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrEditorCommandTool } from './commands';\n\n/**\n * Toolbar glyphs as path data, drawn inline so the editor needs no\n * `provideWrIcons()` — the same reason `<wr-textarea>` inlines its grip.\n *\n * Lucide's (ISC), on its 24-unit grid with a 2-unit stroke; `line` elements are\n * rewritten as the equivalent paths so one `<path>` loop draws every icon.\n */\nexport const TOOL_ICONS: Readonly<Record<WrEditorCommandTool, readonly string[]>> = {\n bold: ['M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8'],\n italic: ['M19 4h-9', 'M14 20H5', 'M15 4 9 20'],\n underline: ['M6 4v6a6 6 0 0 0 12 0V4', 'M4 20h16'],\n strike: ['M16 4H9a3 3 0 0 0-2.83 4', 'M14 12a4 4 0 0 1 0 8H6', 'M4 12h16'],\n code: ['m16 18 6-6-6-6', 'm8 6-6 6 6 6'],\n paragraph: ['M13 4v16', 'M17 4v16', 'M19 4H9.5a4.5 4.5 0 0 0 0 9H13'],\n heading1: ['M4 12h8', 'M4 18V6', 'M12 18V6', 'm17 12 3-2v8'],\n heading2: ['M4 12h8', 'M4 18V6', 'M12 18V6', 'M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1'],\n heading3: [\n 'M4 12h8',\n 'M4 18V6',\n 'M12 18V6',\n 'M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2',\n 'M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2',\n ],\n bulletList: ['M3 5h.01', 'M3 12h.01', 'M3 19h.01', 'M8 5h13', 'M8 12h13', 'M8 19h13'],\n orderedList: [\n 'M11 5h10',\n 'M11 12h10',\n 'M11 19h10',\n 'M4 4h1v5',\n 'M4 9h2',\n 'M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02',\n ],\n blockquote: ['M17 5H3', 'M21 12H8', 'M21 19H8', 'M3 12v7'],\n codeBlock: [\n 'm10 9-3 3 3 3',\n 'm14 15 3-3-3-3',\n 'M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z',\n ],\n link: [\n 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71',\n 'M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71',\n ],\n horizontalRule: ['M5 12h14'],\n undo: ['M9 14 4 9l5-5', 'M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11'],\n redo: ['m15 14 5-5-5-5', 'M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13'],\n};\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { computed, signal } from '@angular/core';\n\nimport type { WrFormFieldContext } from 'ngwr/form';\n\nlet nextId = 0;\n\n/**\n * The field the link panel's URL input belongs to — provided as `WR_FORM_FIELD`\n * for the editor's whole subtree.\n *\n * It does two jobs at once. It is the SHIELD every composite control needs: the\n * editor is the control a `<wr-form-field>` wraps, and without a nearer provider\n * the `[wrInput]` in its link panel would adopt the outer field's id, take over\n * its label and announce its error as its own. And it is the input's own field:\n * `[wrInput]` binds `id`, `aria-invalid` and `aria-describedby` from whatever\n * field it finds, so answering here is how a refused URL reaches a screen reader\n * without binding attributes the directive already owns.\n *\n * @internal\n */\nexport class WrEditorLinkField implements WrFormFieldContext {\n private readonly id = `wr-editor-link-${nextId++}`;\n\n /** The URL just submitted was refused by the link policy. */\n readonly invalid = signal(false);\n\n readonly controlId = signal(`${this.id}-url`).asReadonly();\n readonly errorId = `${this.id}-error`;\n readonly panelId = `${this.id}-panel`;\n\n readonly errorKeys = computed<readonly string[]>(() => (this.invalid() ? ['url'] : []));\n readonly describedBy = computed(() => (this.invalid() ? this.errorId : null));\n readonly labelId = signal<string | null>(null).asReadonly();\n\n adoptControlId(): void {\n // The panel's input never carries an id of its own.\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Node } from 'prosemirror-model';\nimport type { NodeView, NodeViewConstructor, ViewMutationRecord } from 'prosemirror-view';\n\n/** The words a task item is read with — `editor.taskDone` / `editor.taskTodo`. */\ninterface WrTaskLabels {\n readonly done: string;\n readonly todo: string;\n}\n\n/**\n * List items as the editor draws them, which differs from the schema's `toDOM` —\n * what a copy puts on the clipboard — only for a TASK item.\n *\n * A task item's box is presentational, with its state as text beside it — the\n * same drawing as the read-only rendering. A real `<input type=\"checkbox\">` would\n * be an unlabelled form control inside the text, and making it operable would\n * promise an interaction v1 does not have. The box and the words sit outside the\n * editable content, so ProseMirror neither edits nor serializes them; the words\n * come from the catalog, which is why this is a node view the component builds\n * rather than a schema `toDOM` (the schema is shared and has no catalog).\n */\nfunction listItemView(labels: WrTaskLabels): NodeViewConstructor {\n return (node, view) => new WrListItemView(node, view.dom.ownerDocument, labels);\n}\n\nclass WrListItemView implements NodeView {\n readonly dom: HTMLElement;\n readonly contentDOM: HTMLElement;\n private node: Node;\n\n constructor(node: Node, document: Document, labels: WrTaskLabels) {\n this.node = node;\n this.dom = document.createElement('li');\n const checked = node.attrs['checked'] as boolean | null;\n if (checked === null) {\n this.contentDOM = this.dom;\n return;\n }\n\n this.dom.className = 'wr-editor__item wr-editor__item--task';\n this.dom.setAttribute('data-checked', String(checked));\n const box = document.createElement('span');\n box.className = checked ? 'wr-editor__task wr-editor__task--checked' : 'wr-editor__task';\n box.contentEditable = 'false';\n box.setAttribute('aria-hidden', 'true');\n const state = document.createElement('span');\n state.className = 'wr-editor__sr-only';\n state.contentEditable = 'false';\n state.textContent = checked ? labels.done : labels.todo;\n this.contentDOM = document.createElement('div');\n this.contentDOM.className = 'wr-editor__task-body';\n this.dom.append(box, state, this.contentDOM);\n }\n\n update(node: Node): boolean {\n // A task item becoming a plain one (or the reverse, or toggled) is drawn\n // again from scratch; there is no in-place way to add or drop the box.\n if (node.type !== this.node.type || node.attrs['checked'] !== this.node.attrs['checked']) return false;\n this.node = node;\n return true;\n }\n\n ignoreMutation(mutation: ViewMutationRecord): boolean {\n if (mutation.type === 'selection' || this.contentDOM === this.dom) return false;\n return !this.contentDOM.contains(mutation.target);\n }\n}\n\nexport { listItemView };\nexport type { WrTaskLabels };\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { WrEditorTool } from './types';\n\n/**\n * The toolbar `<wr-editor>` draws when `toolbar` is not bound — every tool, in\n * five groups. Exported so a toolbar can be built from it rather than retyped:\n *\n * ```ts\n * readonly tools = WR_EDITOR_TOOLBAR.filter(tool => tool !== 'code');\n * ```\n */\nexport const WR_EDITOR_TOOLBAR: readonly WrEditorTool[] = [\n 'bold',\n 'italic',\n 'underline',\n 'strike',\n 'code',\n '|',\n 'paragraph',\n 'heading1',\n 'heading2',\n 'heading3',\n '|',\n 'bulletList',\n 'orderedList',\n 'blockquote',\n 'codeBlock',\n '|',\n 'link',\n 'horizontalRule',\n '|',\n 'undo',\n 'redo',\n];\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n type Signal,\n ViewEncapsulation,\n afterNextRender,\n afterRenderEffect,\n computed,\n effect,\n inject,\n input,\n isDevMode,\n model,\n output,\n signal,\n untracked,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { wrReadI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrInput } from 'ngwr/input';\nimport { WrPlatform } from 'ngwr/platform';\nimport { WrPopover } from 'ngwr/popover';\nimport { wrIsComposing, wrCheckStyles } from 'ngwr/utils';\nimport type { Node } from 'prosemirror-model';\nimport { EditorState, type Transaction } from 'prosemirror-state';\nimport { Decoration, DecorationSet, EditorView } from 'prosemirror-view';\n\nimport { readValue, writeValue } from './internal/codec';\nimport {\n SHORTCUTS,\n TOGGLES,\n type WrEditorCommandTool,\n editorPlugins,\n linkRange,\n removeLink,\n setLink,\n toolActive,\n toolCommand,\n} from './internal/commands';\nimport { TOOL_ICONS } from './internal/icons';\nimport { WrEditorLinkField } from './internal/link-field';\nimport { listItemView } from './internal/list-item-view';\nimport { safeUrl } from './internal/safe-url';\nimport { editorSchema, isEmptyDoc } from './internal/schema';\nimport { WR_EDITOR_TOOLBAR } from './toolbar';\nimport type { WrEditorJson, WrEditorMarkJson, WrEditorTool, WrEditorValue } from './types';\n\nlet nextId = 0;\n\nfunction warn(message: string): void {\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(`[NGWR] <wr-editor>: ${message}`);\n}\n\n/** One toolbar button's state at the current selection. */\ninterface WrToolState {\n readonly tool: WrEditorCommandTool;\n readonly active: boolean;\n readonly available: boolean;\n}\n\n/**\n * Rich-text editor on ProseMirror, with a toolbar, a link panel, keyboard\n * shortcuts and markdown-style block shortcuts (`# `, `> `, `- `, `1. `,\n * ` ``` `).\n *\n * A signal-forms native control: it implements `FormValueControl<WrEditorValue>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone.\n *\n * The value is the document as a {@link WrEditorJson} tree, `null` when nothing\n * is written. Whatever arrives is treated as untrusted and checked against the\n * editor's schema — every node, mark and attribute, every link and image URL —\n * and is read whole or not at all. A value the editor cannot read is refused:\n * the document it already shows is kept, a warning names the reason in dev\n * mode, and nothing is written back. Until a value it CAN read arrives the\n * editor is read-only and carries `wr-editor--refused`: the model still holds the\n * refused value, and an edit would write the document on screen over it.\n *\n * A paste is the other way content arrives, and it is not a value: ProseMirror\n * parses the clipboard's HTML through the schema's own rules, so whatever the\n * schema does not name is dropped, a link with a refused URL keeps its text and\n * loses the URL, and an image with one is left out.\n *\n * **`readonly` never mounts ProseMirror.** The document is drawn as ordinary\n * Angular markup instead — the same rendering the server prerenders — so a page\n * showing thirty saved comments boots no editor at all, and the headings, lists\n * and tables of what it shows stay in the accessibility tree rather than being\n * swallowed by a textbox, every descendant of which is presentational. It is\n * lazy, not permanent: the first time `readonly` is lifted the editor mounts,\n * and from there behaves exactly as one that never was read-only. Setting it\n * again keeps the mounted view — throwing a live session's undo history away to\n * save one view would cost more than the view.\n *\n * Headings stop at three levels: a pasted h4–h6 becomes an h3 rather than a\n * paragraph, and a value holding one is refused.\n *\n * ProseMirror is an OPTIONAL peer dependency: only an app that imports\n * `ngwr/editor` installs `prosemirror-model`, `-state`, `-view`, `-commands`,\n * `-keymap`, `-history`, `-schema-list` and `-inputrules`.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-editor placeholder=\"Describe the change\" [formField]=\"form.body\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-editor [(value)]=\"doc\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/editor\n */\n@Component({\n selector: 'wr-editor',\n templateUrl: './editor.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-editor',\n '[class]': 'classes()',\n '(focusout)': 'onFocusOut($event)',\n },\n // The editor is the control a `<wr-form-field>` wraps; the `[wrInput]` in its\n // link panel is a part. See `WrEditorLinkField` — the provider is both the\n // shield and that input's own field, which is why `fieldAria` below reads the\n // real field with `skipSelf`.\n providers: [\n { provide: WrEditorLinkField, useFactory: () => new WrEditorLinkField() },\n { provide: WR_FORM_FIELD, useExisting: WrEditorLinkField },\n ],\n imports: [NgTemplateOutlet, WrButton, WrInput, WrPopover],\n})\nexport class WrEditor implements FormValueControl<WrEditorValue> {\n /**\n * The document as a {@link WrEditorJson} tree; `null` when nothing is written.\n * Bound by `[formField]`, or two-way via `[(value)]`.\n */\n readonly value = model<WrEditorValue>(null);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n /**\n * Disable the editor and its toolbar. Bound automatically from the field's\n * disabled state when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse edits while the text stays reachable, selectable and announced.\n * Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * Set before the editor mounts, it means ProseMirror is never started: the\n * document is drawn as ordinary markup in a focusable `role=\"group\"` that\n * keeps the tab stop and carries the editor's name, so a viewer costs no\n * editor and the structure of what it shows is still announced. `aria-readonly`\n * is deliberately absent there — ARIA does not allow it on `group`, and\n * `aria-disabled`, the only attribute that would apply, means something else —\n * so the cue is the `wr-editor--readonly` class. The toolbar goes inert, since\n * none of its tools can apply; a pure viewer binds `[toolbar]=\"false\"`.\n *\n * A view that is already mounted stays mounted, refuses typing, paste, drop,\n * the shortcuts and every toolbar command, and reports `aria-readonly` on its\n * surface as before.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Hint shown while the document is empty, and exposed as `aria-placeholder`.\n *\n * @default ''\n */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name of the text — of the surface, or of the document a\n * read-only editor draws in its place. Falls back to the surrounding\n * `<wr-form-field>`'s label, then to `editor.label`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * The toolbar's tools, in order, with `'|'` between groups; `false` hides it.\n *\n * @default WR_EDITOR_TOOLBAR\n */\n readonly toolbar = input<readonly WrEditorTool[] | false>(WR_EDITOR_TOOLBAR);\n\n private readonly document = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /**\n * Ambient reading direction, read by the toolbar's arrow keys. Optional so a\n * bare `TestBed` needs no provider; `null` means LTR.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n /** @internal */\n protected readonly linkField = inject(WrEditorLinkField, { self: true });\n\n /** The surrounding `<wr-form-field>`'s error state, read past the editor's own shield. @internal */\n protected readonly fieldAria = useFormFieldAria({ skipSelf: true });\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'editor.label', 'Rich text');\n\n /**\n * The field's label names the surface, when there is one — a\n * `contenteditable` is not labelable, so the field's `<label for>` cannot\n * reach it. An explicit `ariaLabel` still wins over both.\n */\n protected readonly labelledBy = computed(() => (this.ariaLabel() ? null : this.fieldAria.labelledBy()));\n\n /** `null` while the field's label carries the name. */\n protected readonly accessibleName = computed(() => (this.labelledBy() ? null : this.resolvedAriaLabel()));\n\n protected readonly surfaceId = `wr-editor-${nextId++}`;\n\n /** ProseMirror owns the surface from here on; until then the preview stands in. */\n protected readonly mounted = signal(false);\n\n /**\n * Read-only and nothing mounted: the preview is not standing in for a surface,\n * it IS the editor, and the surface is not rendered at all. One id, one name\n * and one tab stop move onto it with the job. @internal\n */\n protected readonly staticMode = computed(() => !this.mounted() && this.readonly());\n\n protected readonly focused = signal(false);\n\n private readonly editorState = signal<EditorState | null>(null);\n\n /**\n * Whether `value` holds something the editor could not read, so the document\n * on screen is not the one the model holds — empty at mount, or the previous\n * record after a write. Edits are refused until a readable value arrives:\n * the first keystroke would otherwise replace the stored value with whatever\n * is on screen, and the only sign of it was a dev-mode warning.\n */\n private readonly refused = signal(false);\n\n /** Read-only by the input, or because the value was refused. @internal */\n protected readonly locked = computed(() => this.readonly() || this.refused());\n\n /** Apple keyboards name the modifier ⌘. Read in the browser only — see `mount()`. */\n private readonly apple = signal(false);\n\n // Optional, both of them: exactly one is in the DOM at a time, and which one\n // is the difference between a mounted editor and the static document.\n private readonly surface = viewChild<ElementRef<HTMLElement>>('surface');\n private readonly staticDoc = viewChild<ElementRef<HTMLElement>>('staticDoc');\n // `read`, because `#tool` sits on a `wr-btn` and would otherwise resolve to the component.\n private readonly toolButtons = viewChildren<unknown, ElementRef<HTMLButtonElement>>('tool', { read: ElementRef });\n private readonly linkPopover = viewChild<WrPopover>('linkPopover');\n\n private view: EditorView | null = null;\n /**\n * The value the live document was last read from or written as. A write from\n * outside that equals it is the document already on screen — an echo of the\n * editor's own emit, or a consumer writing back what it was handed — and must\n * neither re-parse nor reset the selection.\n */\n private lastSerialized: WrEditorValue | undefined = undefined;\n private linkToSurface = false;\n /**\n * Whether the static path has already named the refusal the model is holding.\n * A read-only editor reports one itself, and a mount that follows would\n * otherwise warn a second time about the same value.\n */\n private refusalWarned = false;\n\n // Labels\n\n protected readonly toolbarLabel = wrReadI18nText('editor.toolbar', 'Formatting');\n protected readonly linkUrlLabel = wrReadI18nText('editor.linkUrl', 'Link address');\n protected readonly linkApplyLabel = wrReadI18nText('editor.linkApply', 'Apply');\n protected readonly linkRemoveLabel = wrReadI18nText('editor.linkRemove', 'Remove link');\n protected readonly linkInvalidLabel = wrReadI18nText('editor.linkInvalid', 'This address cannot be used as a link.');\n protected readonly taskDoneLabel = wrReadI18nText('editor.taskDone', 'Done:');\n protected readonly taskTodoLabel = wrReadI18nText('editor.taskTodo', 'To do:');\n private readonly keyCtrl = wrReadI18nText('editor.keyCtrl', 'Ctrl');\n private readonly keyShift = wrReadI18nText('editor.keyShift', 'Shift');\n private readonly keyAlt = wrReadI18nText('editor.keyAlt', 'Alt');\n private readonly headingLabel = useI18nFormatter('editor.heading', 'Heading {{level}}');\n private readonly shortcutLabel = useI18nFormatter('editor.shortcut', '{{label}} ({{keys}})');\n\n private readonly toolLabels: Readonly<Record<WrEditorCommandTool, Signal<string>>> = {\n bold: wrReadI18nText('editor.bold', 'Bold'),\n italic: wrReadI18nText('editor.italic', 'Italic'),\n underline: wrReadI18nText('editor.underline', 'Underline'),\n strike: wrReadI18nText('editor.strike', 'Strikethrough'),\n code: wrReadI18nText('editor.code', 'Inline code'),\n paragraph: wrReadI18nText('editor.paragraph', 'Paragraph'),\n heading1: computed(() => this.headingLabel({ level: 1 })),\n heading2: computed(() => this.headingLabel({ level: 2 })),\n heading3: computed(() => this.headingLabel({ level: 3 })),\n bulletList: wrReadI18nText('editor.bulletList', 'Bulleted list'),\n orderedList: wrReadI18nText('editor.orderedList', 'Numbered list'),\n blockquote: wrReadI18nText('editor.blockquote', 'Quote'),\n codeBlock: wrReadI18nText('editor.codeBlock', 'Code block'),\n link: wrReadI18nText('editor.link', 'Insert link'),\n horizontalRule: wrReadI18nText('editor.horizontalRule', 'Horizontal line'),\n undo: wrReadI18nText('editor.undo', 'Undo'),\n redo: wrReadI18nText('editor.redo', 'Redo'),\n };\n\n // Toolbar\n\n /**\n * The bound tools as drawn: each tool once, and separators only BETWEEN two\n * groups — a list filtered from `WR_EDITOR_TOOLBAR`, or built by hand, can\n * leave a leading, trailing or doubled one behind.\n */\n protected readonly tools = computed<readonly WrEditorTool[]>(() => {\n const bound = this.toolbar();\n if (!bound) return [];\n const out: WrEditorTool[] = [];\n for (const tool of bound) {\n if (tool === '|' && (out.length === 0 || out[out.length - 1] === '|')) continue;\n if (tool !== '|' && out.includes(tool)) continue;\n out.push(tool);\n }\n if (out[out.length - 1] === '|') out.pop();\n return out;\n });\n\n /** The tools that are buttons, in order — what the roving tab stop moves over. */\n private readonly buttons = computed(() => this.tools().filter((tool): tool is WrEditorCommandTool => tool !== '|'));\n\n /** Each drawn entry's index among the buttons, `-1` for a separator. @internal */\n protected readonly buttonIndex = computed(() => {\n let index = 0;\n return this.tools().map(tool => (tool === '|' ? -1 : index++));\n });\n\n private readonly commands = computed(() => {\n const schema = editorSchema();\n return new Map(this.buttons().map(tool => [tool, toolCommand(tool, schema)]));\n });\n\n /** Every button's pressed and available state at the current selection. @internal */\n protected readonly toolStates = computed<ReadonlyMap<WrEditorCommandTool, WrToolState>>(() => {\n const state = this.editorState();\n const editable = this.canEdit();\n const commands = this.commands();\n return new Map(\n this.buttons().map(tool => {\n const command = commands.get(tool);\n return [\n tool,\n {\n tool,\n active: !!state && toolActive(tool, state),\n available: !!state && editable && !!command && command(state),\n },\n ];\n })\n );\n });\n\n private readonly rovingIndex = signal(0);\n\n /**\n * The one button in the tab order. It follows the user, and moves off a tool\n * that stopped applying so the toolbar never loses its tab stop — unless NO\n * tool applies (read-only, disabled), where it stays put, because there is\n * nothing to reach.\n */\n private readonly tabStop = computed(() => {\n const buttons = this.buttons();\n const states = this.toolStates();\n const current = Math.min(this.rovingIndex(), Math.max(buttons.length - 1, 0));\n if (states.get(buttons[current])?.available) return current;\n const first = buttons.findIndex(tool => states.get(tool)?.available);\n return first >= 0 ? first : current;\n });\n\n /** Whether the live document is empty — pre-mount, whether the value is. */\n private readonly empty = computed(() => {\n const state = this.editorState();\n if (state) return isEmptyDoc(state.doc);\n const value = this.value();\n return value === null || value === undefined;\n });\n\n /** The task-item words, handed to ProseMirror through its node views. */\n private readonly nodeViews = computed(() => ({\n list_item: listItemView({ done: this.taskDoneLabel(), todo: this.taskTodoLabel() }),\n }));\n\n /**\n * Nothing in the static mode: a hint for input, where no input is taken, and\n * `aria-placeholder` is not among the attributes `role=\"group\"` allows — so\n * one drawn there would be text no screen reader ever reaches.\n */\n protected readonly ariaPlaceholder = computed(() =>\n this.placeholder() && this.empty() && !this.staticMode() ? this.placeholder() : null\n );\n\n // Link panel\n\n protected readonly linkDraft = signal('');\n\n /** Whether the selection is in a link — what the panel's remove button needs. */\n protected readonly linkActive = computed(() => this.toolStates().get('link')?.active ?? false);\n\n /**\n * The value rendered by Angular rather than by ProseMirror: on the server, for\n * the first browser frame, and — for as long as it lasts — in the static mode,\n * where no mount is coming. The value goes through the schema and back out,\n * so it shows exactly the document the editor would mount — defaults filled\n * in, undeclared attributes gone — and nothing for a value it refuses.\n */\n protected readonly preview = computed<WrEditorJson | null>(() => {\n if (this.mounted()) return null;\n try {\n return readValue(this.value(), editorSchema()).toJSON() as WrEditorJson;\n } catch (error) {\n // The browser warns from `sync()` — at the mount, or at the write itself\n // while read-only; the server has neither to wait for.\n if (!this.isBrowser && isDevMode()) this.warnRefused(error);\n return null;\n }\n });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.focused()) parts.push('wr-editor--focused');\n if (this.disabled()) parts.push('wr-editor--disabled');\n else if (this.locked()) parts.push('wr-editor--readonly');\n if (this.refused()) parts.push('wr-editor--refused');\n return parts.join(' ');\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('editor');\n // Outside writes: a form reset, a server load, a patch. Skipped when the\n // value is the document already on screen — see `lastSerialized`.\n effect(() => {\n const value = this.value();\n untracked(() => this.sync(value));\n });\n\n // `editable` and the placeholder are functions ProseMirror asks on every\n // update, so poking it is enough to make it ask again.\n effect(() => {\n this.readonly();\n this.disabled();\n this.refused();\n this.placeholder();\n untracked(() => this.view?.setProps({}));\n });\n\n // The task-item words live in node views, which ProseMirror only redraws\n // when the `nodeViews` prop itself changes.\n effect(() => {\n const nodeViews = this.nodeViews();\n untracked(() => this.view?.setProps({ nodeViews }));\n });\n\n // The roving tab stop is written to the DOM rather than bound: `wr-btn`\n // binds `[attr.tabindex]` on its host (`null` for a native button), and a\n // host binding runs after the template's and removes the attribute on the\n // first pass. Nothing rewrites it after that, so a write after render sticks.\n afterRenderEffect({\n write: () => {\n const stop = this.tabStop();\n this.toolButtons().forEach((ref, index) => (ref.nativeElement.tabIndex = index === stop ? 0 : -1));\n },\n });\n\n // `afterNextRender` alone is not the guard: it keys on the global server\n // flag, not on `PLATFORM_ID`, so a platform test would still run it.\n if (!this.isBrowser) return;\n\n // Mount on the first render that is not read-only — usually the very first\n // one, and otherwise the one that lifts `readonly`. A WRITE phase, so the\n // surface the template puts back is already in the DOM by the time\n // `mount()` looks for it; `mount()` itself happens once and never undoes.\n afterRenderEffect({\n write: () => {\n if (!this.readonly()) this.mount();\n },\n });\n }\n\n /**\n * Focus the editor — what Signal Forms calls to focus this control. Whatever\n * is on screen takes it: the mounted surface, or the static document, which\n * keeps a tab stop for exactly this reason.\n */\n focus(options?: FocusOptions): void {\n const view = this.view;\n // ProseMirror's own `focus()` is a no-op while the view is not editable,\n // and read-only has to stay focusable.\n if (view?.editable) view.focus();\n else (this.surface() ?? this.staticDoc())?.nativeElement.focus(options);\n }\n\n // Template handlers\n\n protected label(tool: WrEditorCommandTool): string {\n return this.toolLabels[tool]();\n }\n\n protected icon(tool: WrEditorCommandTool): readonly string[] {\n return TOOL_ICONS[tool];\n }\n\n protected isToggle(tool: WrEditorCommandTool): boolean {\n return TOGGLES.has(tool);\n }\n\n /** The tooltip: the label, with the shortcut when the tool has one. */\n protected tooltip(tool: WrEditorCommandTool): string {\n const shortcut = SHORTCUTS[tool];\n if (!shortcut) return this.label(tool);\n const keys = this.apple()\n ? `${shortcut.alt ? '⌥' : ''}${shortcut.shift ? '⇧' : ''}⌘${shortcut.key}`\n : [\n this.keyCtrl(),\n ...(shortcut.alt ? [this.keyAlt()] : []),\n ...(shortcut.shift ? [this.keyShift()] : []),\n shortcut.key,\n ].join('+');\n return this.shortcutLabel({ label: this.label(tool), keys });\n }\n\n /** `aria-keyshortcuts` — key names from the ARIA spec, never localised. */\n protected keyShortcuts(tool: WrEditorCommandTool): string | null {\n const shortcut = SHORTCUTS[tool];\n if (!shortcut) return null;\n const mod = this.apple() ? 'Meta' : 'Control';\n const combo = `${mod}+${shortcut.alt ? 'Alt+' : ''}${shortcut.shift ? 'Shift+' : ''}${shortcut.key}`;\n return tool === 'redo' && !this.apple() ? `${combo} Control+Y` : combo;\n }\n\n protected state(tool: WrEditorCommandTool): WrToolState | undefined {\n return this.toolStates().get(tool);\n }\n\n /**\n * A toolbar button was activated.\n *\n * By pointer, focus never left the text (`mousedown` is cancelled), so the\n * caret is put back where the command left it. By keyboard, focus stays on the\n * button, as the toolbar pattern asks — unless the tool no longer applies,\n * which disables it: a disabled button drops its focus on `<body>`, so the text\n * takes it first.\n */\n protected onToolClick(tool: WrEditorCommandTool, event: MouseEvent): void {\n const view = this.view;\n const command = this.commands().get(tool);\n if (!view || !command || !this.canEdit()) return;\n command(view.state, view.dispatch, view);\n if (event.detail !== 0 || !this.state(tool)?.available) view.focus();\n }\n\n protected onToolFocus(index: number): void {\n this.rovingIndex.set(index);\n }\n\n /** The APG toolbar keys: the arrows rove and wrap, Home and End jump. */\n protected onToolbarKeydown(event: KeyboardEvent): void {\n if (wrIsComposing(event) || event.altKey || event.ctrlKey || event.metaKey) return;\n const buttons = this.toolButtons().map(ref => ref.nativeElement);\n const current = buttons.indexOf(event.target as HTMLButtonElement);\n if (current < 0) return;\n const reachable = buttons.map((button, index) => (button.disabled ? -1 : index)).filter(index => index >= 0);\n if (!reachable.length) return;\n\n const rtl = this.dir?.value === 'rtl';\n const at = reachable.indexOf(current);\n let next: number;\n switch (event.key) {\n case 'ArrowRight':\n next = reachable[(at + (rtl ? -1 : 1) + reachable.length) % reachable.length];\n break;\n case 'ArrowLeft':\n next = reachable[(at + (rtl ? 1 : -1) + reachable.length) % reachable.length];\n break;\n case 'Home':\n next = reachable[0];\n break;\n case 'End':\n next = reachable[reachable.length - 1];\n break;\n default:\n return;\n }\n event.preventDefault();\n this.rovingIndex.set(next);\n buttons[next].focus();\n }\n\n /** `touch` once focus leaves the whole control — not when it moves between its own parts. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as globalThis.Node | null;\n if (next && this.withinControl(next)) return;\n const fromPanel = this.inLinkPanel(event.target as globalThis.Node);\n\n // Chromium fires a `focusout` with no `relatedTarget` when the focused\n // element is REMOVED — the link panel closing with focus inside it, or its\n // remove button leaving — and the popover hands focus back only after that.\n // It does the same when Tab runs off the end of the document, which is where\n // the overlay container sits. So where focus went is decided once it has\n // settled, or Escape on the panel marked the field touched with focus never\n // leaving the control.\n if (!next && fromPanel) {\n afterNextRender(\n () => {\n const active = this.document.activeElement;\n if (active && this.withinControl(active)) return;\n this.leaveLinkPanel();\n this.touch.emit();\n },\n { injector: this.injector }\n );\n return;\n }\n\n if (next && fromPanel) this.leaveLinkPanel();\n this.touch.emit();\n }\n\n protected onLinkOpened(): void {\n const state = this.view?.state;\n const range = state ? linkRange(state) : null;\n this.linkDraft.set(range ? String(range.mark.attrs['href'] ?? '') : '');\n this.linkField.invalid.set(false);\n afterNextRender(() => this.focusLinkInput(), { injector: this.injector });\n }\n\n protected onLinkClosed(): void {\n // Back to the text when the panel was opened from it (Mod-K) or when a link\n // was just applied; otherwise the popover has already handed focus back to\n // the toolbar button, which is where Escape should leave it.\n //\n // Only while focus is where the popover left it — on the link button — or\n // nowhere. A click elsewhere on the page closes the panel too, and by then\n // it has put focus where the user wanted it; taking it back sent their next\n // keystrokes into this editor.\n const toSurface = this.linkToSurface;\n this.linkToSurface = false;\n this.linkField.invalid.set(false);\n if (!toSurface) return;\n const active = this.document.activeElement;\n const linkButton = this.toolButtons()[this.buttons().indexOf('link')]?.nativeElement;\n if (!active || active === this.document.body || active === linkButton) this.view?.focus();\n }\n\n protected onLinkInput(event: Event): void {\n this.linkDraft.set((event.target as HTMLInputElement).value);\n this.linkField.invalid.set(false);\n }\n\n protected applyLink(event: Event): void {\n event.preventDefault();\n const view = this.view;\n if (!view || !this.canEdit()) return;\n const draft = this.linkDraft().trim();\n // An emptied field on an existing link means \"no link\".\n if (!draft && this.linkActive()) {\n this.removeLink();\n return;\n }\n const href = draft ? safeUrl(draft, 'link') : null;\n if (!href) {\n this.linkField.invalid.set(true);\n this.focusLinkInput();\n return;\n }\n if (!setLink(href)(view.state, view.dispatch)) return;\n this.linkToSurface = true;\n this.linkPopover()?.close();\n }\n\n protected removeLink(): void {\n const view = this.view;\n if (!view || !this.canEdit()) return;\n removeLink(view.state, view.dispatch);\n this.linkToSurface = true;\n this.linkPopover()?.close();\n }\n\n // Preview helpers — the template's typed view of untyped JSON.\n\n protected nodesOf(raw: unknown): readonly WrEditorJson[] {\n return Array.isArray(raw) ? (raw as readonly WrEditorJson[]) : [];\n }\n\n protected nodeOf(raw: unknown): WrEditorJson {\n return raw as WrEditorJson;\n }\n\n protected markAt(node: WrEditorJson, depth: number): WrEditorMarkJson | null {\n return node.marks?.[depth] ?? null;\n }\n\n protected attr(node: WrEditorJson | WrEditorMarkJson, name: string): unknown {\n return node.attrs?.[name] ?? null;\n }\n\n protected text(node: WrEditorJson | WrEditorMarkJson, name: string): string | null {\n const value = node.attrs?.[name];\n return typeof value === 'string' ? value : null;\n }\n\n protected textOf(node: WrEditorJson): string {\n return (node.content ?? []).map(child => child.text ?? '').join('');\n }\n\n // Internals\n\n /** Whether an edit may happen at all — not while read-only, disabled or refused. */\n private canEdit(): boolean {\n return !this.readonly() && !this.disabled() && !this.refused();\n }\n\n private mount(): void {\n // Once and for all: a second call would drop a live document, and going\n // back to read-only is not a reason to throw a session's history away.\n if (this.view) return;\n // The template draws the surface in every state but the static one, which\n // this is never called out of — after the render that puts it back.\n const surface = this.surface();\n if (!surface) return;\n this.apple.set((this.platform.userAgent ?? '').toLowerCase().includes('mac'));\n const value = untracked(this.value);\n const schema = editorSchema();\n let doc: Node;\n try {\n doc = readValue(value, schema);\n } catch (error) {\n // Never twice for a refusal the static path has already named.\n if (isDevMode() && !this.refusalWarned) this.warnRefused(error);\n doc = schema.topNodeType.createAndFill()!;\n // An empty document over a stored value: see `refused`.\n this.refused.set(true);\n }\n\n const state = this.createState(doc);\n this.view = new EditorView(\n { mount: surface.nativeElement },\n {\n state,\n editable: () => untracked(() => this.canEdit()),\n dispatchTransaction: tr => this.dispatch(tr),\n decorations: current => this.placeholderDecorations(current),\n nodeViews: untracked(this.nodeViews),\n handleKeyDown: (_view, event) => this.onSurfaceKeydown(event),\n }\n );\n this.lastSerialized = value;\n this.editorState.set(state);\n this.mounted.set(true);\n this.destroyRef.onDestroy(() => {\n this.view?.destroy();\n this.view = null;\n });\n }\n\n private createState(doc: Node): EditorState {\n const plugins =\n this.view?.state.plugins ??\n editorPlugins(doc.type.schema, {\n apple: untracked(this.apple),\n canEdit: () => untracked(() => this.canEdit()),\n });\n return EditorState.create({ doc, plugins });\n }\n\n private dispatch(tr: Transaction): void {\n const view = this.view;\n if (!view) return;\n const previous = view.state;\n const next = previous.apply(tr);\n view.updateState(next);\n this.editorState.set(next);\n // A refused transaction leaves the document as it was even though it asked\n // to change it; that is not an edit, and must not reach the model.\n if (next.doc !== previous.doc) this.emit(next.doc);\n }\n\n private emit(doc: Node): void {\n const out = writeValue(doc);\n if (out === this.lastSerialized) return;\n this.lastSerialized = out;\n this.value.set(out);\n }\n\n /**\n * Bring an outside write into the view.\n *\n * Compared as DOCUMENTS, never as values: a tree that leaves a default\n * attribute out, or carries one the schema does not declare, differs from what\n * the editor would write while the documents are equal — and an equal document\n * is left alone, selection and history included. A different one replaces the\n * state wholesale, history with it, which is right for a form reset or a server\n * load: undo back into content the app replaced would be wrong. The normalised\n * form is never written back — that would mark the field dirty on load. A write\n * that arrives mid-composition (IME) replaces the composition too: the model is\n * the source of truth.\n */\n private sync(value: WrEditorValue): void {\n const view = this.view;\n if (!view) {\n // Nothing to bring it into. `preview()` redraws it either way; what it\n // cannot do is REPORT a value it could not read, and in the static mode\n // no mount is coming to do that — so the check happens here instead.\n // Before a mount that IS coming it is `mount()` that reports, and on the\n // server `preview()` does, each exactly once.\n if (this.isBrowser && untracked(this.readonly)) this.readStatically(value);\n return;\n }\n if (value === this.lastSerialized) return;\n\n let doc: Node;\n try {\n doc = readValue(value, editorSchema());\n } catch (error) {\n if (isDevMode()) this.warnRefused(error);\n // The model now holds what the screen does not show.\n this.refused.set(true);\n return;\n }\n\n this.refused.set(false);\n this.lastSerialized = value;\n if (doc.eq(view.state.doc)) return;\n this.replaceState(doc);\n }\n\n /**\n * The check `mount()` makes, made without a mount: the same warning and the\n * same `refused` flag, so an unreadable value is refused whether or not\n * ProseMirror ever starts. Without it a read-only editor met one with silence\n * — `preview()` renders nothing for a document it cannot read, and the model\n * goes on holding a value nothing has said a word about.\n *\n * The parsed document is dropped; `preview()` reads its own. The cost is one\n * extra parse per write, and only while read-only, where a write is rare.\n */\n private readStatically(value: WrEditorValue): void {\n try {\n readValue(value, editorSchema());\n this.refused.set(false);\n this.refusalWarned = false;\n } catch (error) {\n if (isDevMode()) {\n this.warnRefused(error);\n this.refusalWarned = true;\n }\n this.refused.set(true);\n }\n }\n\n private replaceState(doc: Node): void {\n const state = this.createState(doc);\n this.view!.updateState(state);\n this.editorState.set(state);\n }\n\n private placeholderDecorations(state: EditorState): DecorationSet | null {\n const text = untracked(this.placeholder);\n if (!text || !isEmptyDoc(state.doc)) return null;\n const first = state.doc.firstChild!;\n return DecorationSet.create(state.doc, [\n Decoration.node(0, first.nodeSize, { class: 'wr-editor__placeholder', 'data-placeholder': text }),\n ]);\n }\n\n /**\n * Mod-K opens the link panel. Its propagation stops here: `<wr-command-palette>`\n * binds the same chord on the document, and `WrHotkey` deliberately does not\n * skip an event another listener already handled.\n */\n private onSurfaceKeydown(event: KeyboardEvent): boolean {\n if (wrIsComposing(event) || event.altKey || event.shiftKey) return false;\n const mod = untracked(this.apple) ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;\n if (!mod || (event.key.toLowerCase() !== 'k' && event.code !== 'KeyK')) return false;\n const popover = this.linkPopover();\n if (!popover || !untracked(this.toolStates).get('link')?.available) return false;\n event.stopPropagation();\n this.linkToSurface = true;\n popover.open();\n return true;\n }\n\n private focusLinkInput(): void {\n const input = this.document.getElementById(this.linkField.controlId()) as HTMLInputElement | null;\n input?.focus();\n input?.select();\n }\n\n /**\n * Focus left the link panel for somewhere outside the control — Tab, Shift+Tab,\n * a click elsewhere. The panel is not a focus trap, and left open it stays\n * anchored to a control the user has left, whose next close would then pull\n * focus back into the text. Closed with focus left where it went.\n */\n private leaveLinkPanel(): void {\n this.linkToSurface = false;\n this.linkPopover()?.close();\n }\n\n /** Whether a node is part of this control: the host, or its link panel. */\n private withinControl(node: globalThis.Node): boolean {\n return this.host.nativeElement.contains(node) || this.inLinkPanel(node);\n }\n\n private inLinkPanel(node: globalThis.Node): boolean {\n const panel = this.document.getElementById(this.linkField.panelId);\n if (!panel) return false;\n // The popover focuses its own pane before the input takes over.\n return panel.contains(node) || node === panel.closest('.cdk-overlay-pane');\n }\n\n private warnRefused(error: unknown): void {\n const reason = error instanceof Error ? error.message : String(error);\n warn(\n 'the bound value could not be read and was ignored — the editor keeps the document it had and refuses ' +\n `edits until it is given a value it can read, so the stored one is not overwritten. ${reason}`\n );\n }\n}\n","@if (tools().length) {\n <div class=\"wr-editor__toolbar\" role=\"toolbar\" [attr.aria-label]=\"toolbarLabel()\" [attr.aria-controls]=\"surfaceId\">\n @for (item of tools(); track $index; let n = $index) {\n @if (item === '|') {\n <span class=\"wr-editor__separator\" aria-hidden=\"true\"></span>\n } @else if (item === 'link') {\n <!-- The link button hosts the link panel, so it carries the popover's own\n `aria-haspopup` / `aria-expanded` / `aria-controls` — and no tooltip,\n since one element cannot host `[wrPopover]` twice; its name and\n `aria-keyshortcuts` still say what the others' tooltips say. No\n `aria-pressed` either: a button that opens a popup is not a toggle,\n and the panel's remove button is where \"in a link\" is announced. -->\n <button\n #tool\n #linkPopover=\"wrPopover\"\n wr-btn\n type=\"button\"\n class=\"wr-editor__tool\"\n [class.wr-editor__tool--active]=\"state(item)?.active\"\n [disabled]=\"!state(item)?.available\"\n [attr.aria-label]=\"label(item)\"\n [attr.aria-keyshortcuts]=\"keyShortcuts(item)\"\n [wrPopover]=\"linkPanel\"\n [ariaLabel]=\"label(item)\"\n (opened)=\"onLinkOpened()\"\n (closed)=\"onLinkClosed()\"\n (focus)=\"onToolFocus(buttonIndex()[n])\"\n (keydown)=\"onToolbarKeydown($event)\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <svg\n class=\"wr-editor__icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n @for (d of icon(item); track $index) {\n <path [attr.d]=\"d\" />\n }\n </svg>\n </button>\n } @else {\n <button\n #tool\n wr-btn\n type=\"button\"\n class=\"wr-editor__tool\"\n mode=\"tooltip\"\n [class.wr-editor__tool--active]=\"state(item)?.active\"\n [disabled]=\"!state(item)?.available\"\n [attr.aria-pressed]=\"isToggle(item) ? (state(item)?.active ? 'true' : 'false') : null\"\n [attr.aria-label]=\"label(item)\"\n [attr.aria-keyshortcuts]=\"keyShortcuts(item)\"\n [wrPopover]=\"tooltip(item)\"\n (click)=\"onToolClick(item, $event)\"\n (focus)=\"onToolFocus(buttonIndex()[n])\"\n (keydown)=\"onToolbarKeydown($event)\"\n (mousedown)=\"$event.preventDefault()\"\n >\n <svg\n class=\"wr-editor__icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n @for (d of icon(item); track $index) {\n <path [attr.d]=\"d\" />\n }\n </svg>\n </button>\n }\n }\n </div>\n}\n\n<!--\n The document drawn by Angular, in either of the two ways it stands on screen.\n\n In the STATIC mode — read-only with nothing mounted — it is the editor, for as\n long as `readonly` holds, so it takes the id, the name, the field's state and\n the tab stop the surface below would have carried, and that surface is not\n rendered at all: two elements with one id, or a nameless empty textbox beside\n the text, is what rendering both would mean. A focusable `role=\"group\"` and not\n a textbox, because every descendant of a textbox is presentational — the\n headings, lists and tables being shown would stop being announced, which is the\n whole point of showing a document. No `aria-readonly`: ARIA does not allow it\n on `group`, and `.wr-editor--readonly` on the host is the cue instead.\n\n Otherwise it is the preview that stands in until ProseMirror mounts — on the\n server, and for the first browser frame — and carries nothing of the surface's.\n\n Either way it is a SIBLING of the mount surface, never inside it: `{ mount }`\n replaces the element's children, and nodes Angular owns would be deleted out\n from under the next change detection.\n-->\n@if (staticMode()) {\n <div\n #staticDoc\n class=\"wr-editor__preview wr-editor__preview--static wr-editor__content\"\n role=\"group\"\n [id]=\"surfaceId\"\n [attr.aria-label]=\"accessibleName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n (focus)=\"focused.set(true)\"\n (blur)=\"focused.set(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"previewContent\" />\n </div>\n} @else {\n @if (preview()) {\n <div class=\"wr-editor__preview wr-editor__content\">\n <ng-container [ngTemplateOutlet]=\"previewContent\" />\n </div>\n }\n\n <!--\n The mount surface. Angular binds every attribute it needs, so the prerendered\n page and the synchronous first render already carry the role, the name and the\n field's error state; ProseMirror adds only its own class, `contenteditable` and\n `translate`, and never touches an attribute it did not set. No Angular child\n ever lives in here.\n -->\n <div\n #surface\n class=\"wr-editor__surface wr-editor__content\"\n role=\"textbox\"\n aria-multiline=\"true\"\n [id]=\"surfaceId\"\n [hidden]=\"!mounted()\"\n [attr.aria-label]=\"accessibleName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-readonly]=\"locked() && !disabled() ? 'true' : null\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n [attr.aria-placeholder]=\"ariaPlaceholder()\"\n [attr.tabindex]=\"locked() && !disabled() ? 0 : null\"\n (focus)=\"focused.set(true)\"\n (blur)=\"focused.set(false)\"\n ></div>\n}\n\n<!-- The document itself, written once for both of the containers above. -->\n<ng-template #previewContent>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: preview()?.content }\" />\n</ng-template>\n\n<!--\n The popover styles its panel as `.wr-popover-overlay > *`, which is this form,\n so the form stays a plain block and the layout lives one level in.\n-->\n<ng-template #linkPanel>\n <form\n class=\"wr-editor-link\"\n novalidate\n [id]=\"linkField.panelId\"\n (submit)=\"applyLink($event)\"\n (focusout)=\"onFocusOut($event)\"\n >\n <div class=\"wr-editor-link__body\">\n <label class=\"wr-editor-link__label\" [attr.for]=\"linkField.controlId()\">{{ linkUrlLabel() }}</label>\n <input\n wrInput\n class=\"wr-editor-link__input\"\n type=\"text\"\n inputmode=\"url\"\n autocomplete=\"url\"\n spellcheck=\"false\"\n [value]=\"linkDraft()\"\n (input)=\"onLinkInput($event)\"\n />\n @if (linkField.invalid()) {\n <p class=\"wr-editor-link__error\" role=\"alert\" [id]=\"linkField.errorId\">{{ linkInvalidLabel() }}</p>\n }\n <div class=\"wr-editor-link__actions\">\n @if (linkActive()) {\n <button wr-btn type=\"button\" class=\"wr-editor-link__remove\" (click)=\"removeLink()\">\n {{ linkRemoveLabel() }}\n </button>\n }\n <button wr-btn type=\"submit\" color=\"primary\" class=\"wr-editor-link__apply\">{{ linkApplyLabel() }}</button>\n </div>\n </div>\n </form>\n</ng-template>\n\n<!--\n Recursion runs through `ngTemplateOutlet` rather than a child component, so the\n preview is exactly the document with no host element between a `<ul>` and its\n `<li>`.\n-->\n<ng-template #previewBlocks let-raw>\n @for (node of nodesOf(raw); track $index) {\n @switch (node.type) {\n @case ('paragraph') {\n <p [class.wr-editor__placeholder]=\"ariaPlaceholder() !== null\" [attr.data-placeholder]=\"ariaPlaceholder()\">\n <ng-container [ngTemplateOutlet]=\"previewInline\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </p>\n }\n @case ('heading') {\n @switch (attr(node, 'level')) {\n @case (2) {\n <h2>\n <ng-container\n [ngTemplateOutlet]=\"previewInline\"\n [ngTemplateOutletContext]=\"{ $implicit: node.content }\"\n />\n </h2>\n }\n @case (3) {\n <h3>\n <ng-container\n [ngTemplateOutlet]=\"previewInline\"\n [ngTemplateOutletContext]=\"{ $implicit: node.content }\"\n />\n </h3>\n }\n @default {\n <h1>\n <ng-container\n [ngTemplateOutlet]=\"previewInline\"\n [ngTemplateOutletContext]=\"{ $implicit: node.content }\"\n />\n </h1>\n }\n }\n }\n @case ('blockquote') {\n <blockquote>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </blockquote>\n }\n @case ('code_block') {\n <pre><code>{{ textOf(node) }}</code></pre>\n }\n @case ('horizontal_rule') {\n <hr />\n }\n @case ('bullet_list') {\n <ul>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </ul>\n }\n @case ('ordered_list') {\n <ol [attr.start]=\"attr(node, 'order') === 1 ? null : attr(node, 'order')\">\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </ol>\n }\n @case ('list_item') {\n @let checked = attr(node, 'checked');\n @if (checked === null) {\n <li>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </li>\n } @else {\n <li class=\"wr-editor__item wr-editor__item--task\" [attr.data-checked]=\"checked\">\n <span class=\"wr-editor__task\" [class.wr-editor__task--checked]=\"checked === true\" aria-hidden=\"true\"></span>\n <span class=\"wr-editor__sr-only\">{{ checked === true ? taskDoneLabel() : taskTodoLabel() }}</span>\n <div class=\"wr-editor__task-body\">\n <ng-container\n [ngTemplateOutlet]=\"previewBlocks\"\n [ngTemplateOutletContext]=\"{ $implicit: node.content }\"\n />\n </div>\n </li>\n }\n }\n @case ('table') {\n <table>\n <tbody>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </tbody>\n </table>\n }\n @case ('table_row') {\n <tr>\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </tr>\n }\n @case ('table_header') {\n <th [style.text-align]=\"text(node, 'align')\">\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </th>\n }\n @case ('table_cell') {\n <td [style.text-align]=\"text(node, 'align')\">\n <ng-container [ngTemplateOutlet]=\"previewBlocks\" [ngTemplateOutletContext]=\"{ $implicit: node.content }\" />\n </td>\n }\n }\n }\n</ng-template>\n\n<ng-template #previewInline let-raw>\n @for (node of nodesOf(raw); track $index) {\n <ng-container [ngTemplateOutlet]=\"previewMarked\" [ngTemplateOutletContext]=\"{ $implicit: node, depth: 0 }\" />\n }\n</ng-template>\n\n<!-- One mark per level, outermost first — the order the schema ranks them in. -->\n<ng-template #previewMarked let-raw let-depth=\"depth\">\n @let node = nodeOf(raw);\n @let mark = markAt(node, depth);\n @if (mark) {\n @switch (mark.type) {\n @case ('link') {\n <a [href]=\"text(mark, 'href')\" [attr.title]=\"text(mark, 'title')\" rel=\"noopener noreferrer nofollow\"\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></a>\n }\n @case ('strong') {\n <strong\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></strong>\n }\n @case ('em') {\n <em\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></em>\n }\n @case ('underline') {\n <u\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></u>\n }\n @case ('strike') {\n <s\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></s>\n }\n @case ('code') {\n <code\n ><ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n /></code>\n }\n @default {\n <ng-container\n [ngTemplateOutlet]=\"previewMarked\"\n [ngTemplateOutletContext]=\"{ $implicit: node, depth: depth + 1 }\"\n />\n }\n }\n } @else {\n @switch (node.type) {\n @case ('text') {\n <ng-container>{{ node.text }}</ng-container>\n }\n @case ('hard_break') {\n <br />\n }\n @case ('image') {\n <img [src]=\"text(node, 'src')\" [alt]=\"text(node, 'alt') ?? ''\" [attr.title]=\"text(node, 'title')\" />\n }\n }\n }\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,iBAAiB;AAYvB,SAAS,SAAS,OAAgB,QAAc;CAC9C,YAAY,OAAO,CAAC;CACpB,MAAM,MAAM,OAAO,aAAa,KAAK;CACrC,IAAI,IAAI,SAAS,OAAO,aAAa,MAAM,IAAI,WAAW,2CAA2C;CACrG,IAAI,MAAK;CACT,OAAO;AACT;AAEA,SAAS,YAAY,OAAgB,OAAa;CAChD,IAAI,QAAQ,gBAAgB,MAAM,IAAI,WAAW,8CAA8C;CAC/F,IAAI,OAAO,UAAU,YAAY,UAAU,QAA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