@pod-os/elements 0.30.2-rc.8724051.0 → 0.30.2-rc.94c5dad.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/dist/cjs/elements.cjs.js +1 -1
- package/dist/cjs/ion-icon_33.cjs.entry.js +1 -2
- package/dist/cjs/ion-icon_33.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pos-document.cjs.entry.js +9 -6
- package/dist/cjs/pos-document.cjs.entry.js.map +1 -1
- package/dist/cjs/pos-markdown-document.cjs.entry.js +13481 -14042
- package/dist/cjs/pos-markdown-document.cjs.entry.js.map +1 -1
- package/dist/collection/components/pos-document/pos-document.js +10 -7
- package/dist/collection/components/pos-document/pos-document.js.map +1 -1
- package/dist/collection/components/pos-markdown-document/pos-markdown-document.css +17 -0
- package/dist/collection/components/pos-markdown-document/pos-markdown-document.js +33 -25
- package/dist/collection/components/pos-markdown-document/pos-markdown-document.js.map +1 -1
- package/dist/collection/components/pos-markdown-document/rich-editor/PosImageNode.js +25 -21
- package/dist/collection/components/pos-markdown-document/rich-editor/PosImageNode.js.map +1 -1
- package/dist/collection/components/pos-markdown-document/rich-editor/PosRichLinkMark.js +20 -16
- package/dist/collection/components/pos-markdown-document/rich-editor/PosRichLinkMark.js.map +1 -1
- package/dist/collection/components/pos-markdown-document/rich-editor/RichEditor.js +10 -24
- package/dist/collection/components/pos-markdown-document/rich-editor/RichEditor.js.map +1 -1
- package/dist/components/pos-app2.js +1 -2
- package/dist/components/pos-app2.js.map +1 -1
- package/dist/components/pos-document2.js +10 -7
- package/dist/components/pos-document2.js.map +1 -1
- package/dist/components/pos-markdown-document2.js +13483 -14044
- package/dist/components/pos-markdown-document2.js.map +1 -1
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/elements.esm.js.map +1 -1
- package/dist/elements/p-08f92489.entry.js +2 -0
- package/dist/elements/p-08f92489.entry.js.map +1 -0
- package/dist/elements/p-4f8297e8.entry.js +2 -0
- package/dist/elements/p-4f8297e8.entry.js.map +1 -0
- package/dist/elements/{p-411c85a4.entry.js → p-c9ba983f.entry.js} +2 -2
- package/dist/elements/p-c9ba983f.entry.js.map +1 -0
- package/dist/esm/elements.js +1 -1
- package/dist/esm/ion-icon_33.entry.js +1 -2
- package/dist/esm/ion-icon_33.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pos-document.entry.js +9 -6
- package/dist/esm/pos-document.entry.js.map +1 -1
- package/dist/esm/pos-markdown-document.entry.js +13481 -14042
- package/dist/esm/pos-markdown-document.entry.js.map +1 -1
- package/dist/types/components/pos-document/pos-document.d.ts +1 -1
- package/dist/types/components/pos-markdown-document/pos-markdown-document.d.ts +5 -5
- package/dist/types/components/pos-markdown-document/rich-editor/PosImageNode.d.ts +2 -0
- package/dist/types/components/pos-markdown-document/rich-editor/PosRichLinkMark.d.ts +2 -0
- package/dist/types/components/pos-markdown-document/rich-editor/RichEditor.d.ts +1 -9
- package/dist/types/components.d.ts +4 -4
- package/package.json +9 -11
- package/dist/collection/components/pos-markdown-document/html2markdown.js +0 -10
- package/dist/collection/components/pos-markdown-document/html2markdown.js.map +0 -1
- package/dist/collection/components/pos-markdown-document/markdown2html.js +0 -5
- package/dist/collection/components/pos-markdown-document/markdown2html.js.map +0 -1
- package/dist/collection/components/pos-markdown-document/sanitize.js +0 -10
- package/dist/collection/components/pos-markdown-document/sanitize.js.map +0 -1
- package/dist/elements/p-411c85a4.entry.js.map +0 -1
- package/dist/elements/p-581ed3ee.entry.js +0 -3
- package/dist/elements/p-581ed3ee.entry.js.map +0 -1
- package/dist/elements/p-ff3f95dc.entry.js +0 -2
- package/dist/elements/p-ff3f95dc.entry.js.map +0 -1
- package/dist/types/components/pos-markdown-document/html2markdown.d.ts +0 -1
- package/dist/types/components/pos-markdown-document/markdown2html.d.ts +0 -1
- package/dist/types/components/pos-markdown-document/sanitize.d.ts +0 -4
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,i,h as s}from"./p-97889672.js";import{s as e,B as o}from"./p-93f5c8ec.js";const r="iframe{background-color:var(--pos-background-color);width:100%;height:100vh}.error{display:flex;opacity:0.8;background:repeating-linear-gradient(-45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px);flex-direction:column;border:1px solid red;color:black;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}.error ion-icon{color:#282828;--ionicon-stroke-width:calc(var(--width) / 5);font-size:calc(var(--width) / 2)}a{text-decoration:none;width:var(--width);height:var(--height)}.code{font-weight:bold;font-size:calc(var(--width) / 8)}.text{font-size:calc(var(--width) / 20)}";const h=r;const a=class{constructor(s){t(this,s);this.initializeOsEmitter=i(this,"pod-os:init",7);this.resourceLoadedEmitter=i(this,"pod-os:resource-loaded",7);this.errorEmitter=i(this,"pod-os:error",7);this.savingFailed=false;this.loading=true;this.isEditable=false;this.setOs=async t=>{this.os=t}}componentWillLoad(){e.onChange("isLoggedIn",(()=>this.fetchBlob()));this.initializeOsEmitter.emit(this.setOs)}async handleDocumentModified(t){const{file:i,newContent:s}=t.detail;try{this.savingFailed=false;const t=await this.os.files().putFile(i,s);if(!t.ok){this.savingFailed=true;const i=new Error(`Failed to save file: ${t.status} ${t.statusText}`);this.errorEmitter.emit(i)}}catch(t){this.savingFailed=true;this.errorEmitter.emit(t)}}async fetchBlob(){try{this.loading=true;const t=await this.os.files().fetchFile(this.src);const i=this.os.store.get(this.src);this.isEditable=i===null||i===void 0?void 0:i.editable;this.resourceLoadedEmitter.emit(this.src);if(t.blob()){this.file=t;this.error=null}else{this.brokenFile=t}}catch(t){this.error=t}finally{this.loading=false}}render(){if(this.loading){return s("ion-skeleton-text",{animated:true})}if(this.error){return s("div",{class:"error"},this.error.message)}if(this.brokenFile){return s(o,{file:this.brokenFile})}if(this.file.blob().type==="text/markdown"){return s("pos-markdown-document",{editable:this.isEditable,savingFailed:this.savingFailed,file:this.file})}else{return s("iframe",{src:URL.createObjectURL(this.file.blob())})}}static get watchers(){return{os:["fetchBlob"],src:["fetchBlob"]}}};a.style=h;export{a as pos_document};
|
|
2
|
-
//# sourceMappingURL=p-ff3f95dc.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["posDocumentCss","PosDocumentStyle0","PosDocument","constructor","hostRef","this","savingFailed","loading","isEditable","setOs","async","os","componentWillLoad","session","onChange","fetchBlob","initializeOsEmitter","emit","handleDocumentModified","event","file","newContent","detail","response","files","putFile","ok","error","Error","status","statusText","errorEmitter","fetchFile","src","thing","store","get","editable","resourceLoadedEmitter","blob","brokenFile","err","render","h","animated","class","message","BrokenFile","type","URL","createObjectURL"],"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, SolidFile } from '@pod-os/core';\nimport { Component, Event, EventEmitter, h, Listen, 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 file: SolidFile;\n\n @State()\n private brokenFile: BrokenFileData;\n\n @State()\n private error: Error;\n\n @State()\n private savingFailed = false;\n\n @State()\n private loading: boolean = true;\n\n @State()\n private isEditable: boolean = false;\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 /**\n * Emitted when an error occurs during file operations.\n */\n @Event({ eventName: 'pod-os:error' }) errorEmitter: EventEmitter<Error>;\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 @Listen('pod-os:document-modified')\n async handleDocumentModified(event: CustomEvent) {\n const { file, newContent } = event.detail;\n try {\n this.savingFailed = false;\n const response = await this.os.files().putFile(file, newContent);\n if (!response.ok) {\n this.savingFailed = true;\n const error = new Error(`Failed to save file: ${response.status} ${response.statusText}`);\n this.errorEmitter.emit(error);\n }\n } catch (error) {\n this.savingFailed = true;\n this.errorEmitter.emit(error);\n }\n }\n\n @Watch('os')\n @Watch('src')\n async fetchBlob() {\n try {\n this.loading = true;\n const file = await this.os.files().fetchFile(this.src);\n const thing = this.os.store.get(this.src);\n this.isEditable = thing?.editable;\n this.resourceLoadedEmitter.emit(this.src);\n if (file.blob()) {\n this.file = file;\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 if (this.file.blob().type === 'text/markdown') {\n return (\n <pos-markdown-document\n editable={this.isEditable}\n savingFailed={this.savingFailed}\n file={this.file}\n ></pos-markdown-document>\n );\n } else {\n return <iframe src={URL.createObjectURL(this.file.blob())}></iframe>;\n }\n }\n}\n"],"mappings":"wFAAA,MAAMA,EAAiB,uoBACvB,MAAAC,EAAeD,E,MCSFE,EAAW,MALxB,WAAAC,CAAAC,G,oKAsBUC,KAAAC,aAAe,MAGfD,KAAAE,QAAmB,KAGnBF,KAAAG,WAAsB,MAmB9BH,KAAAI,MAAQC,MAAOC,IACbN,KAAKM,GAAKA,CAAE,C,CANd,iBAAAC,GACEC,EAAQC,SAAS,cAAc,IAAMT,KAAKU,cAC1CV,KAAKW,oBAAoBC,KAAKZ,KAAKI,M,CAQrC,4BAAMS,CAAuBC,GAC3B,MAAMC,KAAEA,EAAIC,WAAEA,GAAeF,EAAMG,OACnC,IACEjB,KAAKC,aAAe,MACpB,MAAMiB,QAAiBlB,KAAKM,GAAGa,QAAQC,QAAQL,EAAMC,GACrD,IAAKE,EAASG,GAAI,CAChBrB,KAAKC,aAAe,KACpB,MAAMqB,EAAQ,IAAIC,MAAM,wBAAwBL,EAASM,UAAUN,EAASO,cAC5EzB,KAAK0B,aAAad,KAAKU,E,EAEzB,MAAOA,GACPtB,KAAKC,aAAe,KACpBD,KAAK0B,aAAad,KAAKU,E,EAM3B,eAAMZ,GACJ,IACEV,KAAKE,QAAU,KACf,MAAMa,QAAaf,KAAKM,GAAGa,QAAQQ,UAAU3B,KAAK4B,KAClD,MAAMC,EAAQ7B,KAAKM,GAAGwB,MAAMC,IAAI/B,KAAK4B,KACrC5B,KAAKG,WAAa0B,IAAK,MAALA,SAAK,SAALA,EAAOG,SACzBhC,KAAKiC,sBAAsBrB,KAAKZ,KAAK4B,KACrC,GAAIb,EAAKmB,OAAQ,CACflC,KAAKe,KAAOA,EACZf,KAAKsB,MAAQ,I,KACR,CACLtB,KAAKmC,WAAapB,C,EAEpB,MAAOqB,GACPpC,KAAKsB,MAAQc,C,SAEbpC,KAAKE,QAAU,K,EAInB,MAAAmC,GACE,GAAIrC,KAAKE,QAAS,CAChB,OAAOoC,EAAA,qBAAmBC,SAAU,M,CAEtC,GAAIvC,KAAKsB,MAAO,CACd,OAAOgB,EAAA,OAAKE,MAAM,SAASxC,KAAKsB,MAAMmB,Q,CAExC,GAAIzC,KAAKmC,WAAY,CACnB,OAAOG,EAACI,EAAU,CAAC3B,KAAMf,KAAKmC,Y,CAEhC,GAAInC,KAAKe,KAAKmB,OAAOS,OAAS,gBAAiB,CAC7C,OACEL,EAAA,yBACEN,SAAUhC,KAAKG,WACfF,aAAcD,KAAKC,aACnBc,KAAMf,KAAKe,M,KAGV,CACL,OAAOuB,EAAA,UAAQV,IAAKgB,IAAIC,gBAAgB7C,KAAKe,KAAKmB,S","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function html2markdown(html: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function markdown2html(markdown: string): Promise<string>;
|