@pod-os/elements 0.30.2-rc.15536e2.0 → 0.30.2-rc.86bb4f4.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 (55) hide show
  1. package/dist/cjs/elements.cjs.js +1 -1
  2. package/dist/cjs/ion-icon_33.cjs.entry.js +5 -5
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/pos-document.cjs.entry.js +7 -2
  5. package/dist/cjs/pos-document.cjs.entry.js.map +1 -1
  6. package/dist/cjs/pos-markdown-document.cjs.entry.js +1500 -0
  7. package/dist/cjs/pos-markdown-document.cjs.entry.js.map +1 -0
  8. package/dist/collection/collection-manifest.json +1 -0
  9. package/dist/collection/components/pos-document/pos-document.js +8 -3
  10. package/dist/collection/components/pos-document/pos-document.js.map +1 -1
  11. package/dist/collection/components/pos-markdown-document/pos-markdown-document.css +6 -0
  12. package/dist/collection/components/pos-markdown-document/pos-markdown-document.js +69 -0
  13. package/dist/collection/components/pos-markdown-document/pos-markdown-document.js.map +1 -0
  14. package/dist/collection/components/pos-markdown-document/sanitize.js +10 -0
  15. package/dist/collection/components/pos-markdown-document/sanitize.js.map +1 -0
  16. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js +1 -1
  17. package/dist/collection/components/pos-navigation/pos-navigation.js +1 -1
  18. package/dist/collection/components/pos-new-thing-form/pos-new-thing-form.js +1 -1
  19. package/dist/collection/components/pos-router/pos-router.js +1 -1
  20. package/dist/collection/components/pos-select-term/pos-select-term.js +1 -1
  21. package/dist/components/pos-app-document-viewer.js +12 -6
  22. package/dist/components/pos-app-document-viewer.js.map +1 -1
  23. package/dist/components/pos-document2.js +18 -7
  24. package/dist/components/pos-document2.js.map +1 -1
  25. package/dist/components/pos-markdown-document.d.ts +11 -0
  26. package/dist/components/pos-markdown-document.js +8 -0
  27. package/dist/components/pos-markdown-document.js.map +1 -0
  28. package/dist/components/pos-markdown-document2.js +1514 -0
  29. package/dist/components/pos-markdown-document2.js.map +1 -0
  30. package/dist/components/pos-navigation-bar2.js +1 -1
  31. package/dist/components/pos-navigation2.js +1 -1
  32. package/dist/components/pos-new-thing-form2.js +1 -1
  33. package/dist/components/pos-router2.js +1 -1
  34. package/dist/components/pos-select-term2.js +1 -1
  35. package/dist/elements/elements.esm.js +1 -1
  36. package/dist/elements/elements.esm.js.map +1 -1
  37. package/dist/elements/{p-fe3c0e1b.entry.js → p-c267a78a.entry.js} +2 -2
  38. package/dist/elements/{p-f2e65e83.entry.js → p-c43ec7b2.entry.js} +2 -2
  39. package/dist/elements/p-c43ec7b2.entry.js.map +1 -0
  40. package/dist/elements/p-efdb179c.entry.js +3 -0
  41. package/dist/elements/p-efdb179c.entry.js.map +1 -0
  42. package/dist/esm/elements.js +1 -1
  43. package/dist/esm/ion-icon_33.entry.js +5 -5
  44. package/dist/esm/loader.js +1 -1
  45. package/dist/esm/pos-document.entry.js +7 -2
  46. package/dist/esm/pos-document.entry.js.map +1 -1
  47. package/dist/esm/pos-markdown-document.entry.js +1496 -0
  48. package/dist/esm/pos-markdown-document.entry.js.map +1 -0
  49. package/dist/types/components/pos-document/pos-document.d.ts +1 -1
  50. package/dist/types/components/pos-markdown-document/pos-markdown-document.d.ts +7 -0
  51. package/dist/types/components/pos-markdown-document/sanitize.d.ts +4 -0
  52. package/dist/types/components.d.ts +17 -2
  53. package/package.json +3 -1
  54. package/dist/elements/p-f2e65e83.entry.js.map +0 -1
  55. /package/dist/elements/{p-fe3c0e1b.entry.js.map → p-c267a78a.entry.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ import { SolidFile } from '@pod-os/core';
2
+ export declare class PosMarkdownDocument {
3
+ file: SolidFile;
4
+ private sanitizedHtml;
5
+ componentWillLoad(): Promise<void>;
6
+ render(): any;
7
+ }
@@ -0,0 +1,4 @@
1
+ export interface SanitizedHtml {
2
+ value: string;
3
+ }
4
+ export declare function sanitize(html: string): SanitizedHtml;
@@ -5,9 +5,9 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { PodOS, Thing } from "@pod-os/core";
8
+ import { PodOS, SolidFile, Thing } from "@pod-os/core";
9
9
  import { ToolConfig } from "./components/pos-type-router/selectToolsForTypes";
10
- export { PodOS, Thing } from "@pod-os/core";
10
+ export { PodOS, SolidFile, Thing } from "@pod-os/core";
11
11
  export { ToolConfig } from "./components/pos-type-router/selectToolsForTypes";
12
12
  export namespace Components {
13
13
  interface PosAddLiteralValue {
@@ -102,6 +102,9 @@ export namespace Components {
102
102
  interface PosMakeFindable {
103
103
  "uri": string;
104
104
  }
105
+ interface PosMarkdownDocument {
106
+ "file": SolidFile;
107
+ }
105
108
  interface PosNavigation {
106
109
  /**
107
110
  * Initial value of the navigation bar
@@ -703,6 +706,12 @@ declare global {
703
706
  prototype: HTMLPosMakeFindableElement;
704
707
  new (): HTMLPosMakeFindableElement;
705
708
  };
709
+ interface HTMLPosMarkdownDocumentElement extends Components.PosMarkdownDocument, HTMLStencilElement {
710
+ }
711
+ var HTMLPosMarkdownDocumentElement: {
712
+ prototype: HTMLPosMarkdownDocumentElement;
713
+ new (): HTMLPosMarkdownDocumentElement;
714
+ };
706
715
  interface HTMLPosNavigationElementEventMap {
707
716
  "pod-os:init": any;
708
717
  "pod-os:link": any;
@@ -1043,6 +1052,7 @@ declare global {
1043
1052
  "pos-login": HTMLPosLoginElement;
1044
1053
  "pos-login-form": HTMLPosLoginFormElement;
1045
1054
  "pos-make-findable": HTMLPosMakeFindableElement;
1055
+ "pos-markdown-document": HTMLPosMarkdownDocumentElement;
1046
1056
  "pos-navigation": HTMLPosNavigationElement;
1047
1057
  "pos-navigation-bar": HTMLPosNavigationBarElement;
1048
1058
  "pos-new-thing-form": HTMLPosNewThingFormElement;
@@ -1204,6 +1214,9 @@ declare namespace LocalJSX {
1204
1214
  "onPod-os:search:index-updated"?: (event: PosMakeFindableCustomEvent<any>) => void;
1205
1215
  "uri": string;
1206
1216
  }
1217
+ interface PosMarkdownDocument {
1218
+ "file"?: SolidFile;
1219
+ }
1207
1220
  interface PosNavigation {
1208
1221
  "onPod-os:init"?: (event: PosNavigationCustomEvent<any>) => void;
1209
1222
  "onPod-os:link"?: (event: PosNavigationCustomEvent<any>) => void;
@@ -1373,6 +1386,7 @@ declare namespace LocalJSX {
1373
1386
  "pos-login": PosLogin;
1374
1387
  "pos-login-form": PosLoginForm;
1375
1388
  "pos-make-findable": PosMakeFindable;
1389
+ "pos-markdown-document": PosMarkdownDocument;
1376
1390
  "pos-navigation": PosNavigation;
1377
1391
  "pos-navigation-bar": PosNavigationBar;
1378
1392
  "pos-new-thing-form": PosNewThingForm;
@@ -1435,6 +1449,7 @@ declare module "@stencil/core" {
1435
1449
  "pos-login": LocalJSX.PosLogin & JSXBase.HTMLAttributes<HTMLPosLoginElement>;
1436
1450
  "pos-login-form": LocalJSX.PosLoginForm & JSXBase.HTMLAttributes<HTMLPosLoginFormElement>;
1437
1451
  "pos-make-findable": LocalJSX.PosMakeFindable & JSXBase.HTMLAttributes<HTMLPosMakeFindableElement>;
1452
+ "pos-markdown-document": LocalJSX.PosMarkdownDocument & JSXBase.HTMLAttributes<HTMLPosMarkdownDocumentElement>;
1438
1453
  "pos-navigation": LocalJSX.PosNavigation & JSXBase.HTMLAttributes<HTMLPosNavigationElement>;
1439
1454
  "pos-navigation-bar": LocalJSX.PosNavigationBar & JSXBase.HTMLAttributes<HTMLPosNavigationBarElement>;
1440
1455
  "pos-new-thing-form": LocalJSX.PosNewThingForm & JSXBase.HTMLAttributes<HTMLPosNewThingFormElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pod-os/elements",
3
- "version": "0.30.2-rc.15536e2.0",
3
+ "version": "0.30.2-rc.86bb4f4.0",
4
4
  "description": "Custom elements for usage with Solid Pods",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -27,12 +27,14 @@
27
27
  "@stencil/core": "4.24.0",
28
28
  "@stencil/store": "^2.2.0",
29
29
  "@uvdsl/solid-oidc-client-browser": "^0.1.2",
30
+ "dompurify": "^3.2.7",
30
31
  "idb": "^8.0.3",
31
32
  "pollen-css": "^5.0.2",
32
33
  "rxjs": "^7.8.2",
33
34
  "stencil-router-v2": "^0.6.0"
34
35
  },
35
36
  "devDependencies": {
37
+ "@happy-dom/jest-environment": "^19.0.2",
36
38
  "@testing-library/dom": "^10.4.1",
37
39
  "@testing-library/jest-dom": "^6.9.1",
38
40
  "@types/jest": "^29.5.14",
@@ -1 +0,0 @@
1
- {"version":3,"names":["posDocumentCss","PosDocumentStyle0","PosDocument","constructor","hostRef","this","loading","setOs","async","os","componentWillLoad","session","onChange","fetchBlob","initializeOsEmitter","emit","file","fetchFile","src","resourceLoadedEmitter","blob","dataUri","URL","createObjectURL","error","brokenFile","err","render","h","animated","class","message","BrokenFile"],"sources":["src/components/pos-document/pos-document.css?tag=pos-document&encapsulation=shadow","src/components/pos-document/pos-document.tsx"],"sourcesContent":["iframe {\n background-color: var(--pos-background-color);\n width: 100%;\n height: 100vh;\n}\n\n/* consolidate with styles from pos-image */\n.error {\n display: flex;\n opacity: 0.8;\n background: repeating-linear-gradient(-45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px);\n flex-direction: column;\n border: 1px solid red;\n color: black;\n align-items: center;\n justify-content: center;\n word-break: break-all;\n padding: 1rem;\n box-sizing: border-box;\n}\n\n.error ion-icon {\n color: #282828;\n --ionicon-stroke-width: calc(var(--width) / 5);\n font-size: calc(var(--width) / 2);\n}\n\na {\n text-decoration: none;\n width: var(--width);\n height: var(--height);\n}\n\n.code {\n font-weight: bold;\n font-size: calc(var(--width) / 8);\n}\n\n.text {\n font-size: calc(var(--width) / 20);\n}\n","import { PodOS, BrokenFile as BrokenFileData } from '@pod-os/core';\nimport { Component, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\nimport session from '../../store/session';\nimport { BrokenFile } from '../broken-file/BrokenFile';\n\n@Component({\n tag: 'pos-document',\n styleUrl: 'pos-document.css',\n shadow: true,\n})\nexport class PosDocument {\n @Prop() src: string;\n\n @Prop() alt: string;\n\n @State() os: PodOS;\n\n @State()\n private dataUri: string;\n\n @State()\n private brokenFile: BrokenFileData;\n\n @State()\n private error: Error;\n\n @State()\n private loading: boolean = true;\n\n @Event({ eventName: 'pod-os:init' }) initializeOsEmitter: EventEmitter;\n\n /**\n * Indicates that the resource given in `src` property has been loaded.\n */\n @Event({ eventName: 'pod-os:resource-loaded' }) resourceLoadedEmitter: EventEmitter<string>;\n\n componentWillLoad() {\n session.onChange('isLoggedIn', () => this.fetchBlob());\n this.initializeOsEmitter.emit(this.setOs);\n }\n\n setOs = async (os: PodOS) => {\n this.os = os;\n };\n\n @Watch('os')\n @Watch('src')\n async fetchBlob() {\n try {\n this.loading = true;\n const file = await this.os.fetchFile(this.src);\n this.resourceLoadedEmitter.emit(this.src);\n if (file.blob()) {\n this.dataUri = URL.createObjectURL(file.blob());\n this.error = null;\n } else {\n this.brokenFile = file as BrokenFileData;\n }\n } catch (err) {\n this.error = err;\n } finally {\n this.loading = false;\n }\n }\n\n render() {\n if (this.loading) {\n return <ion-skeleton-text animated={true}></ion-skeleton-text>;\n }\n if (this.error) {\n return <div class=\"error\">{this.error.message}</div>;\n }\n if (this.brokenFile) {\n return <BrokenFile file={this.brokenFile} />;\n }\n return <iframe src={this.dataUri}></iframe>;\n }\n}\n"],"mappings":"wFAAA,MAAMA,EAAiB,uoBACvB,MAAAC,EAAeD,E,MCSFE,EAAW,MALxB,WAAAC,CAAAC,G,yHAsBUC,KAAAC,QAAmB,KAc3BD,KAAAE,MAAQC,MAAOC,IACbJ,KAAKI,GAAKA,CAAE,C,CANd,iBAAAC,GACEC,EAAQC,SAAS,cAAc,IAAMP,KAAKQ,cAC1CR,KAAKS,oBAAoBC,KAAKV,KAAKE,M,CASrC,eAAMM,GACJ,IACER,KAAKC,QAAU,KACf,MAAMU,QAAaX,KAAKI,GAAGQ,UAAUZ,KAAKa,KAC1Cb,KAAKc,sBAAsBJ,KAAKV,KAAKa,KACrC,GAAIF,EAAKI,OAAQ,CACff,KAAKgB,QAAUC,IAAIC,gBAAgBP,EAAKI,QACxCf,KAAKmB,MAAQ,I,KACR,CACLnB,KAAKoB,WAAaT,C,EAEpB,MAAOU,GACPrB,KAAKmB,MAAQE,C,SAEbrB,KAAKC,QAAU,K,EAInB,MAAAqB,GACE,GAAItB,KAAKC,QAAS,CAChB,OAAOsB,EAAA,qBAAmBC,SAAU,M,CAEtC,GAAIxB,KAAKmB,MAAO,CACd,OAAOI,EAAA,OAAKE,MAAM,SAASzB,KAAKmB,MAAMO,Q,CAExC,GAAI1B,KAAKoB,WAAY,CACnB,OAAOG,EAACI,EAAU,CAAChB,KAAMX,KAAKoB,Y,CAEhC,OAAOG,EAAA,UAAQV,IAAKb,KAAKgB,S","ignoreList":[]}