@dotvoid/textbit-plugins 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2023 TT Nyhetsbyrån AB
1
+ Copyright 2023-2026 Dotvoid AB
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
package/README.md CHANGED
@@ -33,9 +33,21 @@ checks this for every plugin against its ES modules output.
33
33
 
34
34
  ## Plugins
35
35
 
36
- Every type and mark is named `base/*`, the namespace for standard content. To
37
- build your own version of a plugin, register it under the same name; give a new
38
- kind of content a namespace of your own.
36
+ Every type and mark is named `base/*`, the namespace for textbit's standard
37
+ content. A `base/image` is always this package's image, with this package's
38
+ document format, in every application that uses textbit.
39
+
40
+ So a plugin of your own gets a namespace of your own, also when it does the same
41
+ job as one of these: your own image plugin is `acme/image`, not `base/image`.
42
+ Registered as `base/image`, it would replace this one under the same name with a
43
+ different document format, and documents, copy and paste, and anything else that
44
+ reads `base/image` could no longer tell the two apart. To change how one of these
45
+ plugins looks or behaves, use its options and the styles.
46
+
47
+ The one exception is `base/text`. Textbit itself creates `base/text` blocks, on
48
+ Enter, on paste and in an empty document, so a plugin that renders text in your
49
+ own way has to keep that name and its format: no role for a paragraph, and
50
+ `properties.role` for anything else.
39
51
 
40
52
  | Plugin | Element types | Default shortcut |
41
53
  |--------|---------------|------------------|
@@ -52,8 +64,8 @@ kind of content a namespace of your own.
52
64
  | `Audio` | `base/audio` | none |
53
65
  | `Blockquote` | `base/blockquote` | none |
54
66
 
55
- `Text`, `Bold`, `Italic` and `Underline` replace textbit's built-in plugins of the
56
- same name and keep their document format, so existing documents keep working.
67
+ `Text` replaces textbit's built-in plain paragraph and keeps its format, adding
68
+ roles for headings and the lead-in.
57
69
 
58
70
  ### Text
59
71
 
@@ -108,7 +120,8 @@ English, ”…” in Swedish, «…» in Norwegian), and two hyphens into an en
108
120
 
109
121
  ### Image and audio
110
122
 
111
- Reference plugins: complete, and meant to be read when you build your own.
123
+ Reference plugins: complete, and meant to be read when you build your own. Give
124
+ yours a namespace of your own, such as `acme/image` (see [Plugins](#plugins)).
112
125
 
113
126
  ```tsx
114
127
  Image({
@@ -17,6 +17,6 @@ export type AudioOptions = {
17
17
  maxSize?: number;
18
18
  labels?: Partial<AudioLabels>;
19
19
  };
20
- /** An audio player with a caption. A reference for building your own, like Image. */
20
+ /** An audio player with a caption. A reference for your own, like Image, under your own namespace. */
21
21
  export declare const Audio: (options?: AudioOptions) => TBPluginDefinition;
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/Audio/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgD,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAMxG,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAIzD,MAAM,MAAM,WAAW,GAAG;IACxB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACzD,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAC9B,CAAA;AAUD,qFAAqF;AACrF,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,kBA+ClD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/Audio/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgD,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAMxG,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAIzD,MAAM,MAAM,WAAW,GAAG;IACxB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACzD,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAC9B,CAAA;AAUD,sGAAsG;AACtG,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,kBA+ClD,CAAA"}
@@ -28,9 +28,10 @@ export type ImageOptions = {
28
28
  labels?: Partial<ImageLabels>;
29
29
  };
30
30
  /**
31
- * An image with a caption and alternative text. A reference for building your
32
- * own: files reach it by drop or from the insert action, and are stored by your
33
- * `upload` function.
31
+ * An image with a caption and alternative text. Files reach it by drop or from
32
+ * the insert action, and are stored by your `upload` function. Also a reference
33
+ * for building your own, which gets a namespace of your own (`acme/image`, not
34
+ * `base/image`).
34
35
  */
35
36
  export declare const Image: (options?: ImageOptions) => TBPluginDefinition;
36
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/Image/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgD,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAMxG,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAIzD,MAAM,MAAM,WAAW,GAAG;IACxB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAA;IACX,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACzD,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAC9B,CAAA;AAYD;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,kBA6DlD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/Image/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgD,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAMxG,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAIzD,MAAM,MAAM,WAAW,GAAG;IACxB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAA;IACX,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACzD,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAC9B,CAAA;AAYD;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,UAAS,YAAiB,KAAG,kBA6DlD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"consume.d.ts","sourceRoot":"","sources":["../../lib/LocalizedQuotationMarks/consume.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAuCzD,eAAO,MAAM,OAAO,EAAE,iBA8GrB,CAAA"}
1
+ {"version":3,"file":"consume.d.ts","sourceRoot":"","sources":["../../lib/LocalizedQuotationMarks/consume.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAuCzD,eAAO,MAAM,OAAO,EAAE,iBA6GrB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotvoid/textbit-plugins",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "license": "MIT",
5
5
  "description": "Ready to use plugins for @dotvoid/textbit: headings, formatting, lists, links, tables, code, images, audio and quotes.",
6
6
  "author": {
@@ -61,9 +61,9 @@
61
61
  "react": "^19.2.0",
62
62
  "react-dom": "^19.2.0",
63
63
  "typescript": "~5.8.3",
64
- "typescript-eslint": "^8.59.2",
65
- "vite": "^7.2.2",
64
+ "typescript-eslint": "^8.72.1",
65
+ "vite": "^7.3.7",
66
66
  "vite-plugin-dts": "^5.0.0",
67
- "vitest": "^4.0.8"
67
+ "vitest": "^4.1.12"
68
68
  }
69
69
  }