@pod-os/elements 0.30.2-rc.a4eda69.0 → 0.30.2-rc.d44969f.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.
Files changed (53) hide show
  1. package/dist/cjs/elements.cjs.js +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/pos-document.cjs.entry.js +9 -6
  4. package/dist/cjs/pos-document.cjs.entry.js.map +1 -1
  5. package/dist/cjs/pos-markdown-document.cjs.entry.js +2046 -3685
  6. package/dist/cjs/pos-markdown-document.cjs.entry.js.map +1 -1
  7. package/dist/collection/components/pos-document/pos-document.js +10 -7
  8. package/dist/collection/components/pos-document/pos-document.js.map +1 -1
  9. package/dist/collection/components/pos-markdown-document/pos-markdown-document.css +17 -0
  10. package/dist/collection/components/pos-markdown-document/pos-markdown-document.js +19 -21
  11. package/dist/collection/components/pos-markdown-document/pos-markdown-document.js.map +1 -1
  12. package/dist/collection/components/pos-markdown-document/rich-editor/PosImageNode.js +25 -21
  13. package/dist/collection/components/pos-markdown-document/rich-editor/PosImageNode.js.map +1 -1
  14. package/dist/collection/components/pos-markdown-document/rich-editor/PosRichLinkMark.js +20 -16
  15. package/dist/collection/components/pos-markdown-document/rich-editor/PosRichLinkMark.js.map +1 -1
  16. package/dist/collection/components/pos-markdown-document/rich-editor/RichEditor.js +10 -24
  17. package/dist/collection/components/pos-markdown-document/rich-editor/RichEditor.js.map +1 -1
  18. package/dist/components/pos-document2.js +10 -7
  19. package/dist/components/pos-document2.js.map +1 -1
  20. package/dist/components/pos-markdown-document2.js +2048 -3687
  21. package/dist/components/pos-markdown-document2.js.map +1 -1
  22. package/dist/elements/elements.esm.js +1 -1
  23. package/dist/elements/elements.esm.js.map +1 -1
  24. package/dist/elements/p-08f92489.entry.js +2 -0
  25. package/dist/elements/p-08f92489.entry.js.map +1 -0
  26. package/dist/elements/p-4f8297e8.entry.js +2 -0
  27. package/dist/elements/p-4f8297e8.entry.js.map +1 -0
  28. package/dist/esm/elements.js +1 -1
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/esm/pos-document.entry.js +9 -6
  31. package/dist/esm/pos-document.entry.js.map +1 -1
  32. package/dist/esm/pos-markdown-document.entry.js +2046 -3685
  33. package/dist/esm/pos-markdown-document.entry.js.map +1 -1
  34. package/dist/types/components/pos-document/pos-document.d.ts +1 -1
  35. package/dist/types/components/pos-markdown-document/pos-markdown-document.d.ts +3 -3
  36. package/dist/types/components/pos-markdown-document/rich-editor/PosImageNode.d.ts +2 -0
  37. package/dist/types/components/pos-markdown-document/rich-editor/PosRichLinkMark.d.ts +2 -0
  38. package/dist/types/components/pos-markdown-document/rich-editor/RichEditor.d.ts +1 -9
  39. package/dist/types/components.d.ts +4 -4
  40. package/package.json +3 -5
  41. package/dist/collection/components/pos-markdown-document/html2markdown.js +0 -10
  42. package/dist/collection/components/pos-markdown-document/html2markdown.js.map +0 -1
  43. package/dist/collection/components/pos-markdown-document/markdown2html.js +0 -5
  44. package/dist/collection/components/pos-markdown-document/markdown2html.js.map +0 -1
  45. package/dist/collection/components/pos-markdown-document/sanitize.js +0 -10
  46. package/dist/collection/components/pos-markdown-document/sanitize.js.map +0 -1
  47. package/dist/elements/p-b479ffbe.entry.js +0 -3
  48. package/dist/elements/p-b479ffbe.entry.js.map +0 -1
  49. package/dist/elements/p-ff3f95dc.entry.js +0 -2
  50. package/dist/elements/p-ff3f95dc.entry.js.map +0 -1
  51. package/dist/types/components/pos-markdown-document/html2markdown.d.ts +0 -1
  52. package/dist/types/components/pos-markdown-document/markdown2html.d.ts +0 -1
  53. package/dist/types/components/pos-markdown-document/sanitize.d.ts +0 -4
@@ -7,7 +7,7 @@ export declare class PosDocument {
7
7
  private file;
8
8
  private brokenFile;
9
9
  private error;
10
- private savingFailed;
10
+ private saveStatus;
11
11
  private loading;
12
12
  private isEditable;
13
13
  initializeOsEmitter: EventEmitter;
@@ -11,14 +11,14 @@ export declare class PosMarkdownDocument {
11
11
  */
12
12
  file: SolidFile;
13
13
  /**
14
- * Whether saving the latest changes failed
14
+ * Current save status
15
15
  */
16
- savingFailed: boolean;
16
+ saveStatus: 'idle' | 'saving' | 'failed';
17
17
  /**
18
18
  * Whether the current user has the permission to edit the file
19
19
  */
20
20
  editable: boolean;
21
- private sanitizedHtml;
21
+ private markdown;
22
22
  private editorEl;
23
23
  private isModified;
24
24
  private editor;
@@ -1 +1,3 @@
1
+ import { NodeViewRenderer } from '@tiptap/core';
2
+ export declare const createNodeView: (baseUrl: string) => NodeViewRenderer;
1
3
  export declare const PosImageNode: (baseUrl: string) => import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any>;
@@ -1 +1,3 @@
1
+ import { MarkViewRenderer } from '@tiptap/core';
2
+ export declare const createMarkViewRenderer: (baseUrl: string) => MarkViewRenderer;
1
3
  export declare const PosRichLinkMark: (baseUrl: string) => import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any>;
@@ -1,24 +1,16 @@
1
- import { SanitizedHtml } from '../sanitize';
2
1
  export declare class RichEditor {
3
2
  private readonly editor;
4
- /**
5
- * Whether the editor has been modified since the latest changes have been observed
6
- * @private
7
- */
8
- private modified;
9
- private editingJustChanged;
10
3
  private readonly modifications;
11
4
  /**
12
5
  * @param target The element to render to
13
6
  * @param content The content to show in the editor
14
7
  * @param baseUrl Base URL for relative links and relative image src
15
8
  */
16
- constructor(target: HTMLElement, content: SanitizedHtml, baseUrl: string);
9
+ constructor(target: HTMLElement, content: string, baseUrl: string);
17
10
  onUpdate(callback: () => void): void;
18
11
  isEditable(): boolean;
19
12
  startEditing(): void;
20
13
  stopEditing(): void;
21
- isModified(): boolean;
22
14
  getContent(): string;
23
15
  /**
24
16
  * Provides an observable that communicates the latest editor content after changes have settled
@@ -112,9 +112,9 @@ export namespace Components {
112
112
  */
113
113
  "file": SolidFile;
114
114
  /**
115
- * Whether saving the latest changes failed
115
+ * Current save status
116
116
  */
117
- "savingFailed": boolean;
117
+ "saveStatus": 'idle' | 'saving' | 'failed';
118
118
  /**
119
119
  * Switch to editing mode
120
120
  */
@@ -1267,9 +1267,9 @@ declare namespace LocalJSX {
1267
1267
  */
1268
1268
  "onPod-os:document-modified"?: (event: PosMarkdownDocumentCustomEvent<ModifiedFile>) => void;
1269
1269
  /**
1270
- * Whether saving the latest changes failed
1270
+ * Current save status
1271
1271
  */
1272
- "savingFailed"?: boolean;
1272
+ "saveStatus"?: 'idle' | 'saving' | 'failed';
1273
1273
  }
1274
1274
  interface PosNavigation {
1275
1275
  "onPod-os:init"?: (event: PosNavigationCustomEvent<any>) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pod-os/elements",
3
- "version": "0.30.2-rc.a4eda69.0",
3
+ "version": "0.30.2-rc.d44969f.0",
4
4
  "description": "Custom elements for usage with Solid Pods",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -29,16 +29,14 @@
29
29
  "@testing-library/user-event": "^14.6.1",
30
30
  "@tiptap/core": "^3.7.2",
31
31
  "@tiptap/extension-image": "^3.7.2",
32
+ "@tiptap/markdown": "^3.7.2",
32
33
  "@tiptap/pm": "^3.7.2",
33
34
  "@tiptap/starter-kit": "^3.7.2",
34
- "@types/turndown": "^5.0.5",
35
35
  "@uvdsl/solid-oidc-client-browser": "^0.1.3",
36
- "dompurify": "^3.3.0",
37
36
  "idb": "^8.0.3",
38
37
  "pollen-css": "^5.0.2",
39
38
  "rxjs": "^7.8.2",
40
- "stencil-router-v2": "^0.6.0",
41
- "turndown": "^7.2.1"
39
+ "stencil-router-v2": "^0.6.0"
42
40
  },
43
41
  "devDependencies": {
44
42
  "@happy-dom/jest-environment": "^19.0.2",
@@ -1,10 +0,0 @@
1
- import TurndownService from "turndown";
2
- const turndown = new TurndownService({
3
- headingStyle: 'atx',
4
- bulletListMarker: '-',
5
- codeBlockStyle: 'fenced',
6
- });
7
- export function html2markdown(html) {
8
- return turndown.turndown(html);
9
- }
10
- //# sourceMappingURL=html2markdown.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"html2markdown.js","sourceRoot":"","sources":["../../../../src/components/pos-markdown-document/html2markdown.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,UAAU,CAAC;AAEvC,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC;IACnC,YAAY,EAAE,KAAK;IACnB,gBAAgB,EAAE,GAAG;IACrB,cAAc,EAAE,QAAQ;CACzB,CAAC,CAAC;AAEH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import TurndownService from 'turndown';\n\nconst turndown = new TurndownService({\n headingStyle: 'atx',\n bulletListMarker: '-',\n codeBlockStyle: 'fenced',\n});\n\nexport function html2markdown(html: string): string {\n return turndown.turndown(html);\n}\n"]}
@@ -1,5 +0,0 @@
1
- import { marked } from "marked";
2
- export async function markdown2html(markdown) {
3
- return await marked(markdown);
4
- }
5
- //# sourceMappingURL=markdown2html.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdown2html.js","sourceRoot":"","sources":["../../../../src/components/pos-markdown-document/markdown2html.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAgB;IAClD,OAAO,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC","sourcesContent":["import { marked } from 'marked';\n\nexport async function markdown2html(markdown: string) {\n return await marked(markdown);\n}\n"]}
@@ -1,10 +0,0 @@
1
- import DomPurify from "dompurify";
2
- export function sanitize(html) {
3
- return {
4
- value: DomPurify.sanitize(html, {
5
- ADD_TAGS: ['pos-rich-link', 'pos-image'],
6
- ADD_ATTR: ['uri'],
7
- }),
8
- };
9
- }
10
- //# sourceMappingURL=sanitize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sanitize.js","sourceRoot":"","sources":["../../../../src/components/pos-markdown-document/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAMlC,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO;QACL,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE;YAC9B,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,CAAC;YACxC,QAAQ,EAAE,CAAC,KAAK,CAAC;SAClB,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import DomPurify from 'dompurify';\n\nexport interface SanitizedHtml {\n value: string;\n}\n\nexport function sanitize(html: string): SanitizedHtml {\n return {\n value: DomPurify.sanitize(html, {\n ADD_TAGS: ['pos-rich-link', 'pos-image'],\n ADD_ATTR: ['uri'],\n }),\n };\n}\n"]}