@fusion.dev/helix-headless 0.220.0 → 0.221.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/types/svelte.d.ts CHANGED
@@ -75,6 +75,7 @@ declare module 'svelte/elements' {
75
75
  'helix-headless-drawer': Helix<'helix-headless-drawer'>
76
76
  'helix-headless-drilldown-item': Helix<'helix-headless-drilldown-item'>
77
77
  'helix-headless-drilldown': Helix<'helix-headless-drilldown'>
78
+ 'helix-headless-editor': Helix<'helix-headless-editor'>
78
79
  'helix-headless-empty': Helix<'helix-headless-empty'>
79
80
  'helix-headless-file-input': Helix<'helix-headless-file-input'>
80
81
  'helix-headless-filter-chip': Helix<'helix-headless-filter-chip'>
package/types/vue.d.ts CHANGED
@@ -95,6 +95,7 @@ import type {
95
95
  HelixHeadlessDrawer,
96
96
  HelixHeadlessDrilldown,
97
97
  HelixHeadlessDrilldownItem,
98
+ HelixHeadlessEditor,
98
99
  HelixHeadlessEmpty,
99
100
  HelixHeadlessFileInput,
100
101
  HelixHeadlessFilterChip,
@@ -3887,7 +3888,7 @@ Here rather than on each control. */
3887
3888
  /** The problems in the text, each underlined and listed under the editor. */
3888
3889
  diagnostics?: (HelixHeadlessCodeEditor["diagnostics"]) | undefined;
3889
3890
  /** What draws the editor, such as `codeMirrorEngine()` from
3890
- `@fusion.dev/helix-editor`. Absent, the editor is a plain text field. */
3891
+ `@fusion.dev/helix-code-editor`. Absent, the editor is a plain text field. */
3891
3892
  engine?: (HelixHeadlessCodeEditor["engine"]) | undefined;
3892
3893
  };
3893
3894
 
@@ -7764,6 +7765,133 @@ export type HelixHeadlessDrilldownVueEvents = {
7764
7765
  "helix-select": HelixHeadlessDrilldownHelixSelectElementEvent;
7765
7766
  };
7766
7767
 
7768
+ /** `HelixHeadlessEditor` component event */
7769
+ export type HelixHeadlessEditorElementEvent<E = Event> = TypedEvent<
7770
+ HelixHeadlessEditor,
7771
+ E
7772
+ >;
7773
+ /** `helix-found` event type */
7774
+ export type HelixHeadlessEditorHelixFoundElementEvent =
7775
+ HelixHeadlessEditorElementEvent<HelixFoundEvent>;
7776
+
7777
+ export type HelixHeadlessEditorVueProps = {
7778
+ /** The block menu button's name. `{name}` is the block type at the selection. */
7779
+ "block-chosen-label"?: (HelixHeadlessEditor["blockChosenLabel"]) | undefined;
7780
+ /** The block menu button's name. `{name}` is the block type at the selection. */
7781
+ blockChosenLabel?: (HelixHeadlessEditor["blockChosenLabel"]) | undefined;
7782
+ /** The block menu's name, read by screen readers. */
7783
+ "block-label"?: (HelixHeadlessEditor["blockLabel"]) | undefined;
7784
+ /** The block menu's name, read by screen readers. */
7785
+ blockLabel?: (HelixHeadlessEditor["blockLabel"]) | undefined;
7786
+ /** The Bold button's label. */
7787
+ "bold-label"?: (HelixHeadlessEditor["boldLabel"]) | undefined;
7788
+ /** The Bold button's label. */
7789
+ boldLabel?: (HelixHeadlessEditor["boldLabel"]) | undefined;
7790
+ /** The Bulleted list button's label. */
7791
+ "bullet-list-label"?: (HelixHeadlessEditor["bulletListLabel"]) | undefined;
7792
+ /** The Bulleted list button's label. */
7793
+ bulletListLabel?: (HelixHeadlessEditor["bulletListLabel"]) | undefined;
7794
+ /** The Code block row's label in the block menu. */
7795
+ "code-block-label"?: (HelixHeadlessEditor["codeBlockLabel"]) | undefined;
7796
+ /** The Code block row's label in the block menu. */
7797
+ codeBlockLabel?: (HelixHeadlessEditor["codeBlockLabel"]) | undefined;
7798
+ /** The Code button's label. */
7799
+ "code-label"?: (HelixHeadlessEditor["codeLabel"]) | undefined;
7800
+ /** The Code button's label. */
7801
+ codeLabel?: (HelixHeadlessEditor["codeLabel"]) | undefined;
7802
+ /** The toolbar's name, read by screen readers. */
7803
+ "controls-label"?: (HelixHeadlessEditor["controlsLabel"]) | undefined;
7804
+ /** The toolbar's name, read by screen readers. */
7805
+ controlsLabel?: (HelixHeadlessEditor["controlsLabel"]) | undefined;
7806
+ /** The document's name where `label` is empty and the host has no `aria-label`. */
7807
+ "fallback-label"?: (HelixHeadlessEditor["fallbackLabel"]) | undefined;
7808
+ /** The document's name where `label` is empty and the host has no `aria-label`. */
7809
+ fallbackLabel?: (HelixHeadlessEditor["fallbackLabel"]) | undefined;
7810
+ /** The Find button's label, and the find bar's name. */
7811
+ "find-label"?: (HelixHeadlessEditor["findLabel"]) | undefined;
7812
+ /** The Find button's label, and the find bar's name. */
7813
+ findLabel?: (HelixHeadlessEditor["findLabel"]) | undefined;
7814
+ /** A heading's name in the block menu. `{level}` is its level, 1 to 3. */
7815
+ "heading-label"?: (HelixHeadlessEditor["headingLabel"]) | undefined;
7816
+ /** A heading's name in the block menu. `{level}` is its level, 1 to 3. */
7817
+ headingLabel?: (HelixHeadlessEditor["headingLabel"]) | undefined;
7818
+ /** The Italic button's label. */
7819
+ "italic-label"?: (HelixHeadlessEditor["italicLabel"]) | undefined;
7820
+ /** The Italic button's label. */
7821
+ italicLabel?: (HelixHeadlessEditor["italicLabel"]) | undefined;
7822
+ /** The document's name, read by screen readers. Name what it holds, such as
7823
+ "Release notes", so that several editors on one page can be told apart.
7824
+ Required. */
7825
+ label?: (HelixHeadlessEditor["label"]) | undefined;
7826
+ /** The Apply button's label in the address bar. */
7827
+ "link-apply-label"?: (HelixHeadlessEditor["linkApplyLabel"]) | undefined;
7828
+ /** The Apply button's label in the address bar. */
7829
+ linkApplyLabel?: (HelixHeadlessEditor["linkApplyLabel"]) | undefined;
7830
+ /** The close button's label in the address bar. */
7831
+ "link-close-label"?: (HelixHeadlessEditor["linkCloseLabel"]) | undefined;
7832
+ /** The close button's label in the address bar. */
7833
+ linkCloseLabel?: (HelixHeadlessEditor["linkCloseLabel"]) | undefined;
7834
+ /** The name of the address bar's toolbar, read by screen readers. */
7835
+ "link-controls-label"?: (HelixHeadlessEditor["linkControlsLabel"]) | undefined;
7836
+ /** The name of the address bar's toolbar, read by screen readers. */
7837
+ linkControlsLabel?: (HelixHeadlessEditor["linkControlsLabel"]) | undefined;
7838
+ /** The address field's name, which it also shows while it is empty. */
7839
+ "link-field-label"?: (HelixHeadlessEditor["linkFieldLabel"]) | undefined;
7840
+ /** The address field's name, which it also shows while it is empty. */
7841
+ linkFieldLabel?: (HelixHeadlessEditor["linkFieldLabel"]) | undefined;
7842
+ /** The Link button's label, and the address bar's name. */
7843
+ "link-label"?: (HelixHeadlessEditor["linkLabel"]) | undefined;
7844
+ /** The Link button's label, and the address bar's name. */
7845
+ linkLabel?: (HelixHeadlessEditor["linkLabel"]) | undefined;
7846
+ /** The Remove button's label in the address bar. */
7847
+ "link-remove-label"?: (HelixHeadlessEditor["linkRemoveLabel"]) | undefined;
7848
+ /** The Remove button's label in the address bar. */
7849
+ linkRemoveLabel?: (HelixHeadlessEditor["linkRemoveLabel"]) | undefined;
7850
+ /** The Numbered list button's label. */
7851
+ "ordered-list-label"?: (HelixHeadlessEditor["orderedListLabel"]) | undefined;
7852
+ /** The Numbered list button's label. */
7853
+ orderedListLabel?: (HelixHeadlessEditor["orderedListLabel"]) | undefined;
7854
+ /** The Paragraph row's label in the block menu. */
7855
+ "paragraph-label"?: (HelixHeadlessEditor["paragraphLabel"]) | undefined;
7856
+ /** The Paragraph row's label in the block menu. */
7857
+ paragraphLabel?: (HelixHeadlessEditor["paragraphLabel"]) | undefined;
7858
+ /** The words shown in an empty document, such as "Write the release notes". */
7859
+ placeholder?: (HelixHeadlessEditor["placeholder"]) | undefined;
7860
+ /** The Quote button's label. */
7861
+ "quote-label"?: (HelixHeadlessEditor["quoteLabel"]) | undefined;
7862
+ /** The Quote button's label. */
7863
+ quoteLabel?: (HelixHeadlessEditor["quoteLabel"]) | undefined;
7864
+ /** Shows the document and takes no edits, with no toolbar, for a document
7865
+ someone reads, or one an agent is writing. The attribute is `readonly`,
7866
+ the platform's spelling. */
7867
+ readonly?: (HelixHeadlessEditor["readOnly"]) | undefined;
7868
+ /** Shows the document and takes no edits, with no toolbar, for a document
7869
+ someone reads, or one an agent is writing. The attribute is `readonly`,
7870
+ the platform's spelling. */
7871
+ readOnly?: (HelixHeadlessEditor["readOnly"]) | undefined;
7872
+ /** The Redo button's label. */
7873
+ "redo-label"?: (HelixHeadlessEditor["redoLabel"]) | undefined;
7874
+ /** The Redo button's label. */
7875
+ redoLabel?: (HelixHeadlessEditor["redoLabel"]) | undefined;
7876
+ /** The Strikethrough button's label. */
7877
+ "strike-label"?: (HelixHeadlessEditor["strikeLabel"]) | undefined;
7878
+ /** The Strikethrough button's label. */
7879
+ strikeLabel?: (HelixHeadlessEditor["strikeLabel"]) | undefined;
7880
+ /** Which groups of tools the toolbar draws, as a list of `history`, `block`,
7881
+ `marks`, `link`, `lists`, and `quote`, or `none`. They are drawn in that
7882
+ order, whatever order the list is in. Absent is all six. */
7883
+ tools?: (HelixHeadlessEditor["tools"]) | undefined;
7884
+ /** The Undo button's label. */
7885
+ "undo-label"?: (HelixHeadlessEditor["undoLabel"]) | undefined;
7886
+ /** The Undo button's label. */
7887
+ undoLabel?: (HelixHeadlessEditor["undoLabel"]) | undefined;
7888
+ };
7889
+
7890
+ export type HelixHeadlessEditorVueEvents = {
7891
+ /** The find bar searched or moved among the matches, with `count` and the selected match's `index`, counting from 0, or -1 for none. */
7892
+ "helix-found": HelixHeadlessEditorHelixFoundElementEvent;
7893
+ };
7894
+
7767
7895
  export type HelixHeadlessEmptyVueProps = {
7768
7896
  /** The heading as words, such as "No results", drawn as a heading when
7769
7897
  nothing is slotted into `heading`.
@@ -22766,7 +22894,7 @@ export interface WcToolkitVueGlobalComponents {
22766
22894
  HelixHeadlessCodeBlockVueProps,
22767
22895
  HelixHeadlessCodeBlockVueEvents
22768
22896
  >;
22769
- /** A pane for working on a file: a header with its name, its language and the page's own actions, the code, the problems in it, and a status line that says where the caret is. On its own the code is a '<textarea>' in the code face. Connect an engine and it draws the code instead: 'connectEditor' from '@fusion.dev/helix-editor' connects CodeMirror, with highlighting in your theme's syntax colors, line numbers, folding, bracket matching and history. The value, the form, validation and the events stay the editor's, so a page reads and writes it the same either way. For a few lines in a form, such as a setting in JSON, use 'Code Input', which needs no engine. - 'language' picks the highlighting, such as 'ts', 'css', 'html', 'md', 'json', 'python', 'rust' or 'sh', and the header names it. - 'diagnostics' marks problems, from a linter or a language server: each is underlined in the text, its line number is drawn in its tone, and it is listed under the code, where pressing it moves the caret to it. - The find bar finds, with the case, whole words or a regular expression, and replaces once its first button shows the replace field, in the engine or in the plain field alike. - Every change goes through 'requestValue', so a listener refusing 'helix-before-change' refuses the keystroke, in the engine too. **Keyboard.** Command+F, or Control+F elsewhere, opens the find bar, Enter and Shift+Enter move between matches, and Escape closes it. In an engine, Tab indents and Escape then Tab leaves the editor, so the editor is never a trap for a reader without a pointer. */
22897
+ /** A pane for working on a file: a header with its name, its language and the page's own actions, the code, the problems in it, and a status line that says where the caret is. On its own the code is a '<textarea>' in the code face. Connect an engine and it draws the code instead: 'connectCodeEditor' from '@fusion.dev/helix-code-editor' connects CodeMirror, with highlighting in your theme's syntax colors, line numbers, folding, bracket matching and history. The value, the form, validation and the events stay the editor's, so a page reads and writes it the same either way. For a few lines in a form, such as a setting in JSON, use 'Code Input', which needs no engine. - 'language' picks the highlighting, such as 'ts', 'css', 'html', 'md', 'json', 'python', 'rust' or 'sh', and the header names it. - 'diagnostics' marks problems, from a linter or a language server: each is underlined in the text, its line number is drawn in its tone, and it is listed under the code, where pressing it moves the caret to it. - The find bar finds, with the case, whole words or a regular expression, and replaces once its first button shows the replace field, in the engine or in the plain field alike. - Every change goes through 'requestValue', so a listener refusing 'helix-before-change' refuses the keystroke, in the engine too. **Keyboard.** Command+F, or Control+F elsewhere, opens the find bar, Enter and Shift+Enter move between matches, and Escape closes it. In an engine, Tab indents and Escape then Tab leaves the editor, so the editor is never a trap for a reader without a pointer. */
22770
22898
  "helix-headless-code-editor": DefineCustomElement<
22771
22899
  HelixHeadlessCodeEditor,
22772
22900
  HelixHeadlessCodeEditorVueProps,
@@ -22886,6 +23014,12 @@ export interface WcToolkitVueGlobalComponents {
22886
23014
  HelixHeadlessDrilldownVueProps,
22887
23015
  HelixHeadlessDrilldownVueEvents
22888
23016
  >;
23017
+ /** Wraps a document drawn by ProseMirror or another rich text editor. The frame adds a toolbar, an address bar for links, and a box the document is drawn in. 'connectEditor' from '@fusion.dev/helix-editor' connects ProseMirror: it gives the document Helix's typed blocks, each with a stable id, and draws them in your theme. The document is the element you write inside the frame, so it stays in the page: the browser's input methods, spellcheck, and right-to-left text work in it as they do in any field. A server can send the document's HTML there, and it reads before any script loads. Mark it 'data-prose', so the base layer draws its headings, lists, and quotes before a renderer connects. The toolbar's groups are named by 'tools', in this order: 'history' (Undo and Redo), 'block' (a menu of Paragraph, three headings, and Code block), 'marks' (Bold, Italic, Strikethrough, and Code), 'link', 'lists' (Bulleted and Numbered), and 'quote', which are drawn by default, and 'find', the Find button, which is drawn where 'tools' names it. A tool the renderer cannot run is left out once it is connected, and a tool that cannot apply at the selection is disabled. A tool returns focus to the document once it has run. With 'readonly', the document cannot be edited and the toolbar is not drawn. Command+F opens a find bar under the toolbar, a Find that searches the document through the renderer, marks every match, and selects one. It replaces unless the document is 'readonly', which it searches too. **Keyboard.** In the document: - Command+B, Command+I, Command+Shift+X, and Command+E make text bold, italic, struck through, and code. Use Control in place of Command on Windows and Linux. - Command+Alt+0 makes a paragraph, Command+Alt+1 to 3 a heading, and Command+Alt+8 a code block. - Command+Shift+8, Command+Shift+7, and Command+Shift+9 make a bulleted list, a numbered list, and a quote. - Command+K opens the address bar for a link. Enter applies the address, and Escape closes the bar. - Command+Z undoes, and Command+Shift+Z redoes. - In a list, Tab nests the item and Shift+Tab lifts it. Escape then Tab leaves the document from anywhere, so a list never keeps focus. - Alt+F10 moves focus to the toolbar. The arrow keys move between its tools, and Escape returns to the document. - Command+F opens the find bar. Enter and Shift+Enter move between the matches, and Escape closes the bar and returns to the document. */
23018
+ "helix-headless-editor": DefineCustomElement<
23019
+ HelixHeadlessEditor,
23020
+ HelixHeadlessEditorVueProps,
23021
+ HelixHeadlessEditorVueEvents
23022
+ >;
22889
23023
  /** Shows what would be in a region and the one action that would fill it, so an empty region does not look like one that failed to load. The message is announced, because an empty view often replaces content that was loading, and the announcement tells a screen reader user that the search returned nothing. It is announced from a status region of its own, which is rendered empty and filled a frame after the view appears. Screen readers read a region that arrives with its text already in it inconsistently. For the seven seconds the region holds its copy, the heading and the message are hidden from screen readers, so the words are in the page once. Every region is a bare slot. There is no 'empty-state-heading' or 'empty-state-actions' element: assign your own heading and actions to the slots. The icon, the message and the actions slots are parts of the same names, as Card's regions are. A slot draws no box, so a part passes inherited properties, such as color and font, to what is slotted, and a page wanting a box there gives it one with 'display', such as a row of actions with 'display: flex'. **The view says which regions it holds**, as ':state(has-icon)' and ':state(has-actions)', so a sheet can space a view with no icon or no actions differently. Read in the browser, so a served view carries neither until the script runs. **Or give the heading as words.** 'heading' draws them in a 'heading' part that is a heading at 'heading-level', 3 where it is not set, so a page rendering from data or on a server gets a heading a reader finds in the outline without writing the element. A heading slotted in replaces it. **Whatever is slotted into 'heading' is read as a heading.** An element that is no heading, such as a '<span>' or a '<p>', is set inside the 'heading' part at 'heading-level', so a screen reader still finds it in the outline. A heading element, or an element holding one, keeps its own level. A server cannot see the slotted element, so a served '<span>' becomes a heading once the script runs. */
22890
23024
  "helix-headless-empty": DefineCustomElement<
22891
23025
  HelixHeadlessEmpty,
package/types/words.d.ts CHANGED
@@ -1889,6 +1889,146 @@ declare module '@fusion.dev/helix-core' {
1889
1889
  */
1890
1890
  loadingText: Message
1891
1891
  }
1892
+ 'helix-editor': {
1893
+ /**
1894
+ * The block menu button's name. `{name}` is the block type at the selection.
1895
+ *
1896
+ * English: `Text style: {name}`
1897
+ */
1898
+ blockChosenLabel: Message
1899
+ /**
1900
+ * The block menu's name, read by screen readers.
1901
+ *
1902
+ * English: `Text style`
1903
+ */
1904
+ blockLabel: Message
1905
+ /**
1906
+ * The Bold button's label.
1907
+ *
1908
+ * English: `Bold`
1909
+ */
1910
+ boldLabel: Message
1911
+ /**
1912
+ * The Bulleted list button's label.
1913
+ *
1914
+ * English: `Bulleted list`
1915
+ */
1916
+ bulletListLabel: Message
1917
+ /**
1918
+ * The Code block row's label in the block menu.
1919
+ *
1920
+ * English: `Code block`
1921
+ */
1922
+ codeBlockLabel: Message
1923
+ /**
1924
+ * The Code button's label.
1925
+ *
1926
+ * English: `Code`
1927
+ */
1928
+ codeLabel: Message
1929
+ /**
1930
+ * The toolbar's name, read by screen readers.
1931
+ *
1932
+ * English: `Formatting`
1933
+ */
1934
+ controlsLabel: Message
1935
+ /**
1936
+ * The document's name where `label` is empty and the host has no `aria-label`.
1937
+ *
1938
+ * English: `Editor`
1939
+ */
1940
+ fallbackLabel: Message
1941
+ /**
1942
+ * The Find button's label, and the find bar's name.
1943
+ *
1944
+ * English: `Find`
1945
+ */
1946
+ findLabel: Message
1947
+ /**
1948
+ * A heading's name in the block menu. `{level}` is its level, 1 to 3.
1949
+ *
1950
+ * English: `Heading {level}`
1951
+ */
1952
+ headingLabel: Message
1953
+ /**
1954
+ * The Italic button's label.
1955
+ *
1956
+ * English: `Italic`
1957
+ */
1958
+ italicLabel: Message
1959
+ /**
1960
+ * The Apply button's label in the address bar.
1961
+ *
1962
+ * English: `Apply link`
1963
+ */
1964
+ linkApplyLabel: Message
1965
+ /**
1966
+ * The close button's label in the address bar.
1967
+ *
1968
+ * English: `Close`
1969
+ */
1970
+ linkCloseLabel: Message
1971
+ /**
1972
+ * The name of the address bar's toolbar, read by screen readers.
1973
+ *
1974
+ * English: `Link controls`
1975
+ */
1976
+ linkControlsLabel: Message
1977
+ /**
1978
+ * The address field's name, which it also shows while it is empty.
1979
+ *
1980
+ * English: `Address`
1981
+ */
1982
+ linkFieldLabel: Message
1983
+ /**
1984
+ * The Link button's label, and the address bar's name.
1985
+ *
1986
+ * English: `Link`
1987
+ */
1988
+ linkLabel: Message
1989
+ /**
1990
+ * The Remove button's label in the address bar.
1991
+ *
1992
+ * English: `Remove link`
1993
+ */
1994
+ linkRemoveLabel: Message
1995
+ /**
1996
+ * The Numbered list button's label.
1997
+ *
1998
+ * English: `Numbered list`
1999
+ */
2000
+ orderedListLabel: Message
2001
+ /**
2002
+ * The Paragraph row's label in the block menu.
2003
+ *
2004
+ * English: `Paragraph`
2005
+ */
2006
+ paragraphLabel: Message
2007
+ /**
2008
+ * The Quote button's label.
2009
+ *
2010
+ * English: `Quote`
2011
+ */
2012
+ quoteLabel: Message
2013
+ /**
2014
+ * The Redo button's label.
2015
+ *
2016
+ * English: `Redo`
2017
+ */
2018
+ redoLabel: Message
2019
+ /**
2020
+ * The Strikethrough button's label.
2021
+ *
2022
+ * English: `Strikethrough`
2023
+ */
2024
+ strikeLabel: Message
2025
+ /**
2026
+ * The Undo button's label.
2027
+ *
2028
+ * English: `Undo`
2029
+ */
2030
+ undoLabel: Message
2031
+ }
1892
2032
  'helix-file-input': {
1893
2033
  /**
1894
2034
  * What a reader hears when a drop or a paste adds files, with `{names}` and