stilo-editor 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +76 -129
  2. package/dist/content.css +238 -1
  3. package/dist/core/editor.d.ts +15 -3
  4. package/dist/core/extension-manager.d.ts +3 -3
  5. package/dist/core/extension.d.ts +6 -1
  6. package/dist/core/helpers/block-style.d.ts +25 -0
  7. package/dist/core/helpers/input-rules.d.ts +8 -1
  8. package/dist/core/helpers/lists.d.ts +10 -2
  9. package/dist/core/helpers/marks.d.ts +14 -0
  10. package/dist/core/helpers/nodes.d.ts +12 -0
  11. package/dist/core/helpers/word-count.d.ts +14 -0
  12. package/dist/core/html/css.d.ts +16 -1
  13. package/dist/core/html/paste/base-styles.d.ts +7 -0
  14. package/dist/core/html/paste/google-docs.d.ts +7 -0
  15. package/dist/core/html/paste/index.d.ts +9 -0
  16. package/dist/core/html/paste/table-widths.d.ts +7 -0
  17. package/dist/core/html/paste/word.d.ts +8 -0
  18. package/dist/core/html/serialize.d.ts +2 -2
  19. package/dist/extensions/code-block/index.d.ts +24 -0
  20. package/dist/extensions/default-extensions/index.d.ts +11 -0
  21. package/dist/extensions/heading/index.d.ts +2 -1
  22. package/dist/extensions/image/image-view.d.ts +27 -0
  23. package/dist/extensions/image/index.d.ts +29 -0
  24. package/dist/extensions/index.d.ts +10 -1
  25. package/dist/extensions/line-height/index.d.ts +18 -0
  26. package/dist/extensions/list-item/index.d.ts +1 -1
  27. package/dist/extensions/paragraph/index.d.ts +4 -4
  28. package/dist/extensions/search/index.d.ts +55 -0
  29. package/dist/extensions/table/index.d.ts +70 -0
  30. package/dist/extensions/task-item/index.d.ts +24 -0
  31. package/dist/extensions/task-item/task-item-view.d.ts +24 -0
  32. package/dist/extensions/task-list/index.d.ts +11 -0
  33. package/dist/extensions/text-align/index.d.ts +18 -0
  34. package/dist/extensions/text-case/index.d.ts +14 -0
  35. package/dist/extensions/text-style/font-size.d.ts +21 -0
  36. package/dist/extensions/text-style/index.d.ts +18 -2
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +1 -1
  39. package/dist/src-CV6pgfTS.js +2662 -0
  40. package/dist/style.css +599 -1
  41. package/dist/ui/components/dropdown.d.ts +9 -0
  42. package/dist/ui/components/find-bar.d.ts +24 -0
  43. package/dist/ui/components/font-size-input.d.ts +21 -0
  44. package/dist/ui/components/icon-menu.d.ts +20 -0
  45. package/dist/ui/components/status-bar.d.ts +19 -0
  46. package/dist/ui/components/table-actions.d.ts +25 -0
  47. package/dist/ui/components/table-handles.d.ts +16 -0
  48. package/dist/ui/components/table-menu.d.ts +21 -0
  49. package/dist/ui/i18n/types.d.ts +1 -1
  50. package/dist/ui/index.d.ts +6 -2
  51. package/dist/ui/toolbar/fonts.d.ts +8 -0
  52. package/dist/ui/toolbar/items.d.ts +23 -2
  53. package/dist/ui/toolbar/types.d.ts +67 -4
  54. package/dist/ui.css +361 -0
  55. package/dist/ui.js +1361 -303
  56. package/package.json +19 -9
  57. package/dist/src-3tAxKI0c.js +0 -1316
@@ -1,14 +1,30 @@
1
1
  import type { Command } from 'prosemirror-state';
2
+ import { type FontSizeUnit } from './font-size';
2
3
  declare module '../../core/types' {
3
4
  interface Commands {
4
5
  /** Colors the selection. Returns `false` when `color` is not a valid CSS color. */
5
6
  setColor: (color: string) => Command;
6
7
  /** Removes the text color from the selection. */
7
8
  unsetColor: () => Command;
9
+ /** Sets the font family list of the selection. Returns `false` when no name is valid. */
10
+ setFontFamily: (fontFamily: string) => Command;
11
+ /** Removes the font family from the selection. */
12
+ unsetFontFamily: () => Command;
13
+ /** Sets the font size of the selection (`px`, `pt`, `em`, `rem`, `%`); `false` if invalid. */
14
+ setFontSize: (fontSize: string) => Command;
15
+ /** Removes the font size from the selection. */
16
+ unsetFontSize: () => Command;
17
+ /**
18
+ * Changes the font size of each selected part (or of the next typed text) from the size it
19
+ * has on the page to the next whole number in `unit` (`delta` 1) or the previous one (`-1`),
20
+ * between 1 and 400. Default unit `pt`.
21
+ */
22
+ stepFontSize: (delta: number, unit?: FontSizeUnit) => Command;
8
23
  }
9
24
  }
10
25
  /**
11
- * The `textStyle` mark (`<span style="color: x">`), docs/SPEC.md F-208. Also parsed from
12
- * `<font color>`. Font family and size (F-210, F-211) will be further attributes of this mark.
26
+ * The `textStyle` mark (`<span style="font-family: x; font-size: y; color: z">`), docs/SPEC.md
27
+ * F-208, F-210, F-211. Also parsed from `<font face size color>`.
13
28
  */
14
29
  export declare const TextStyle: (options?: Partial<Record<string, never>> | undefined) => import("../..").Extension<Record<string, never>>;
30
+ export { type FontSizeUnit, getFontSize, toFontSize } from './font-size';
package/dist/index.d.ts CHANGED
@@ -9,5 +9,6 @@ export { toggleList } from './core/helpers/lists';
9
9
  export { setMark, toggleMark, unsetMark } from './core/helpers/marks';
10
10
  export { insertBlock, insertBlockNode } from './core/helpers/nodes';
11
11
  export { textDecorationRules } from './core/helpers/parse-rules';
12
+ export { getWordCount, type WordCount } from './core/helpers/word-count';
12
13
  export type { CommandFactories, CommandFactory, CommandName, CommandRunner, CommandRunners, Commands, EditorEvents, EditorOptions, JSONContent, SetContentOptions, } from './core/types';
13
14
  export * from './extensions';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { D as Blockquote, E as Bold, T as BulletList, w as ClearFormatting, C as Code, I as DEFAULT_PRIORITY, S as Document, x as DropCursor, R as Editor, b as GapCursor, y as HardBreak, v as Heading, _ as Highlight, g as History, h as HorizontalRule, m as Italic, p as Link, f as ListItem, d as MoveBlock, u as OrderedList, l as Paragraph, c as Placeholder, H as StiloError, s as Strike, o as Subscript, a as Superscript, i as Text, r as TextStyle, n as Underline, z as attrsMatch, t as defaultExtensions, L as defineExtension, k as insertBlock, A as insertBlockNode, B as isMarkActive, V as isNodeActive, F as markInputRule, j as setMark, O as textDecorationRules, P as toggleList, M as toggleMark, N as unsetMark } from "./src-3tAxKI0c.js";
1
+ export { B as Blockquote, z as Bold, R as BulletList, L as ClearFormatting, I as Code, F as CodeBlock, X as DEFAULT_PRIORITY, P as Document, N as DropCursor, Q as Editor, M as GapCursor, j as HardBreak, A as Heading, k as Highlight, O as History, D as HorizontalRule, E as Image, T as Italic, w as LineHeight, C as Link, S as ListItem, x as MoveBlock, b as OrderedList, y as Paragraph, v as Placeholder, g as Search, nt as StiloError, h as Strike, m as Subscript, p as Superscript, d as Table, u as TaskItem, l as TaskList, c as Text, s as TextAlign, o as TextCase, r as TextStyle, n as Underline, $ as attrsMatch, t as defaultExtensions, Z as defineExtension, i as getFontSize, _ as getSearchResults, f as getTableHeaders, V as getWordCount, U as insertBlock, W as insertBlockNode, et as isMarkActive, tt as isNodeActive, Y as markInputRule, G as setMark, H as textDecorationRules, a as toFontSize, J as toggleList, K as toggleMark, q as unsetMark } from "./src-CV6pgfTS.js";