@teipublisher/pb-components 1.40.2 → 1.41.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/CHANGELOG.md +20 -0
- package/dist/demo/pb-code-editor.html +12 -9
- package/dist/{iron-form-f540b15b.js → iron-form-9e72ac45.js} +1 -1
- package/dist/jinn-codemirror-cc5827eb.js +1 -0
- package/dist/{paper-checkbox-f6a70487.js → paper-checkbox-102e3b43.js} +120 -120
- package/dist/pb-code-editor.js +22 -0
- package/dist/pb-components-bundle.js +234 -234
- package/dist/pb-edit-app.js +33 -33
- package/dist/pb-elements.json +61 -16
- package/dist/pb-i18n-6ad23bcf.js +1 -0
- package/dist/pb-message-0fb0b538.js +911 -0
- package/dist/pb-odd-editor.js +125 -82
- package/package.json +4 -5
- package/pb-elements.json +61 -16
- package/src/pb-code-editor.js +51 -663
- package/src/pb-components.js +0 -1
- package/src/pb-odd-model-editor.js +68 -23
- package/src/pb-odd-parameter-editor.js +17 -9
- package/src/pb-odd-rendition-editor.js +19 -9
- package/css/codemirror/3024-day.css +0 -41
- package/css/codemirror/3024-night.css +0 -39
- package/css/codemirror/abbott.css +0 -268
- package/css/codemirror/abcdef.css +0 -32
- package/css/codemirror/ambiance-mobile.css +0 -5
- package/css/codemirror/ambiance.css +0 -74
- package/css/codemirror/ayu-dark.css +0 -44
- package/css/codemirror/ayu-mirage.css +0 -45
- package/css/codemirror/base16-dark.css +0 -40
- package/css/codemirror/base16-light.css +0 -38
- package/css/codemirror/bespin.css +0 -34
- package/css/codemirror/blackboard.css +0 -32
- package/css/codemirror/cobalt.css +0 -25
- package/css/codemirror/colorforth.css +0 -33
- package/css/codemirror/darcula.css +0 -53
- package/css/codemirror/dracula.css +0 -40
- package/css/codemirror/duotone-dark.css +0 -35
- package/css/codemirror/duotone-light.css +0 -36
- package/css/codemirror/eclipse.css +0 -23
- package/css/codemirror/elegant.css +0 -13
- package/css/codemirror/erlang-dark.css +0 -34
- package/css/codemirror/gruvbox-dark.css +0 -39
- package/css/codemirror/hopscotch.css +0 -34
- package/css/codemirror/icecoder.css +0 -43
- package/css/codemirror/idea.css +0 -42
- package/css/codemirror/isotope.css +0 -34
- package/css/codemirror/juejin.css +0 -30
- package/css/codemirror/lesser-dark.css +0 -47
- package/css/codemirror/liquibyte.css +0 -95
- package/css/codemirror/lucario.css +0 -37
- package/css/codemirror/material-darker.css +0 -135
- package/css/codemirror/material-ocean.css +0 -141
- package/css/codemirror/material-palenight.css +0 -141
- package/css/codemirror/material.css +0 -141
- package/css/codemirror/mbo.css +0 -37
- package/css/codemirror/mdn-like.css +0 -46
- package/css/codemirror/midnight.css +0 -39
- package/css/codemirror/monokai.css +0 -41
- package/css/codemirror/moxer.css +0 -143
- package/css/codemirror/neat.css +0 -12
- package/css/codemirror/neo.css +0 -43
- package/css/codemirror/night.css +0 -27
- package/css/codemirror/nord.css +0 -42
- package/css/codemirror/oceanic-next.css +0 -46
- package/css/codemirror/panda-syntax.css +0 -85
- package/css/codemirror/paraiso-dark.css +0 -38
- package/css/codemirror/paraiso-light.css +0 -38
- package/css/codemirror/pastel-on-dark.css +0 -52
- package/css/codemirror/railscasts.css +0 -34
- package/css/codemirror/rubyblue.css +0 -25
- package/css/codemirror/seti.css +0 -44
- package/css/codemirror/shadowfox.css +0 -52
- package/css/codemirror/solarized.css +0 -168
- package/css/codemirror/ssms.css +0 -16
- package/css/codemirror/the-matrix.css +0 -30
- package/css/codemirror/tomorrow-night-bright.css +0 -35
- package/css/codemirror/tomorrow-night-eighties.css +0 -38
- package/css/codemirror/ttcn.css +0 -64
- package/css/codemirror/twilight.css +0 -32
- package/css/codemirror/vibrant-ink.css +0 -34
- package/css/codemirror/xq-dark.css +0 -53
- package/css/codemirror/xq-light.css +0 -43
- package/css/codemirror/yeti.css +0 -44
- package/css/codemirror/yonce.css +0 -59
- package/css/codemirror/zenburn.css +0 -37
- package/dist/pb-message-1a0c0c52.js +0 -1360
- package/lib/codemirror/addon/display/placeholder.js +0 -70
- package/lib/codemirror/addon/edit/matchbrackets.js +0 -152
- package/lib/codemirror/addon/lint/lint.js +0 -282
- package/lib/codemirror/mode/css/css.js +0 -855
- package/lib/codemirror/mode/stex/stex.js +0 -249
- package/lib/codemirror/mode/xml/xml.js +0 -404
- package/lib/codemirror/mode/xquery/xquery.js +0 -434
package/dist/pb-edit-app.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"./paper-checkbox-102e3b43.js";import{p as e,L as t,h as p,c as o}from"./pb-mixin-15ff531f.js";import{t as i}from"./pb-i18n-6ad23bcf.js";import"./iron-form-9e72ac45.js";class a extends(e(t)){static get properties(){return Object.assign(Object.assign({},super.properties),{},{error:{type:String},url:{type:String},templates:{type:Array},odds:{type:Array}})}constructor(){super(),this.templates=[],this.odds=[]}connectedCallback(){super.connectedCallback()}firstUpdated(){const e=this.shadowRoot.getElementById("form"),t=this.shadowRoot.getElementById("defaultView"),p=this.shadowRoot.getElementById("index"),o=this.shadowRoot.getElementById("template");this.subscribeTo("pb-i18n-update",e=>{const t=this.shadowRoot.querySelector("#defaultView paper-listbox");let p=t.selected;t.selected=void 0,t.selected=p;const o=this.shadowRoot.querySelector("#index paper-listbox");p=o.selected,o.selected=void 0,o.selected=p},[]),a.waitOnce("pb-page-ready",e=>{let t;t=this.minApiVersion("1.0.0")?e.endpoint+"/api/templates":e.endpoint+"/modules/lib/components-list-templates.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.templates=e}),t=this.minApiVersion("1.0.0")?e.endpoint+"/api/odd":e.endpoint+"/modules/lib/components-list-odds.xql",fetch(t,{method:"GET",mode:"cors",credentials:"same-origin"}).then(e=>e.json()).then(e=>{this.odds=e});const p=this.shadowRoot.querySelector("form");this.minApiVersion("1.0.0")?p.action=e.endpoint+"/api/apps/generate":p.action=e.endpoint+"/modules/components-generate.xql"}),e.addEventListener("iron-form-presubmit",(function(){const e=t.selectedItem.getAttribute("value");this.request.body["default-view"]=e,this.request.body.index=p.selectedItem.getAttribute("value"),this.request.body.template=o.selectedItem.getAttribute("value")})),e.addEventListener("iron-form-response",e=>{console.log(e),e.detail.completes.then(e=>{this.emitTo("pb-end-update");const t=e.parseResponse();if(console.log("<pb-edit-app> Received response: %o",t),t.target){const e=window.location.href.replace(/^(.*)\/tei-publisher\/.*/,"$1");this.url=e+"/"+this.shadowRoot.querySelector("paper-input[name=abbrev]").value,this.error=null}else this.error=t.description;this.shadowRoot.getElementById("dialog").open()})}),e.addEventListener("iron-form-error",e=>{this.emitTo("pb-end-update"),console.log("<pb-edit-app> Received response: %o",e.detail.request.response),this.error=e.detail.request.response.description,this.shadowRoot.getElementById("dialog").open()}),e.addEventListener("iron-form-invalid",()=>this.emitTo("pb-end-update"))}_doSubmit(){this.emitTo("pb-start-update");this.shadowRoot.getElementById("form").submit()}render(){return p`
|
|
2
2
|
<iron-form id="form">
|
|
3
3
|
<form method="POST" accept="application/json" enctype="application/json">
|
|
4
4
|
<fieldset>
|
|
5
|
-
<legend>${
|
|
6
|
-
${this.odds.map(e=>
|
|
5
|
+
<legend>${i("document.selectODD")}</legend>
|
|
6
|
+
${this.odds.map(e=>p`<paper-checkbox name="odd" value="${e.name}">${e.label}</paper-checkbox>`)}
|
|
7
7
|
</fieldset>
|
|
8
8
|
<paper-input name="uri" type="url" required placeholder="http://exist-db.org/apps/my-simple-app"
|
|
9
|
-
label="${
|
|
10
|
-
<paper-input id="abbrev" name="abbrev" pattern="[a-zA-Z0-9-_]+" required placeholder="${
|
|
11
|
-
label="${
|
|
9
|
+
label="${i("appgen.uri")}" auto-validate></paper-input>
|
|
10
|
+
<paper-input id="abbrev" name="abbrev" pattern="[a-zA-Z0-9-_]+" required placeholder="${i("appgen.abbrev.placeholder")}"
|
|
11
|
+
label="${i("appgen.abbrev.label")}" auto-validate></paper-input>
|
|
12
12
|
<paper-input name="data-collection" pattern="[a-zA-Z0-9-_/]+" placeholder="data"
|
|
13
|
-
label="${
|
|
14
|
-
<paper-input name="title" required placeholder="${
|
|
15
|
-
label="${
|
|
13
|
+
label="${i("appgen.collection")}" auto-validate></paper-input>
|
|
14
|
+
<paper-input name="title" required placeholder="${i("appgen.title.label")}"
|
|
15
|
+
label="${i("appgen.title.help")}"></paper-input>
|
|
16
16
|
<fieldset>
|
|
17
|
-
<legend>${
|
|
18
|
-
<paper-dropdown-menu id="template" label="${
|
|
17
|
+
<legend>${i("appgen.template.help")}</legend>
|
|
18
|
+
<paper-dropdown-menu id="template" label="${i("appgen.template.label")}" name="template">
|
|
19
19
|
<paper-listbox slot="dropdown-content" class="dropdown-content" attr-for-selected="value" selected="view.html">
|
|
20
|
-
${this.templates.map(e=>
|
|
20
|
+
${this.templates.map(e=>p`<paper-item value="${e.name}">${e.title}</paper-item>`)}
|
|
21
21
|
</paper-listbox>
|
|
22
22
|
</paper-dropdown-menu>
|
|
23
23
|
</fieldset>
|
|
24
24
|
<fieldset>
|
|
25
|
-
<legend>${
|
|
26
|
-
<paper-dropdown-menu id="defaultView" label="${
|
|
25
|
+
<legend>${i("appgen.view.help")}</legend>
|
|
26
|
+
<paper-dropdown-menu id="defaultView" label="${i("appgen.label")}" name="default-view">
|
|
27
27
|
<paper-listbox slot="dropdown-content" class="dropdown-content" selected="div" attr-for-selected="value">
|
|
28
|
-
<paper-item value="div">${
|
|
29
|
-
<paper-item value="page">${
|
|
28
|
+
<paper-item value="div">${i("appgen.view.div")}</paper-item>
|
|
29
|
+
<paper-item value="page">${i("appgen.view.page")}</paper-item>
|
|
30
30
|
</paper-listbox>
|
|
31
31
|
</paper-dropdown-menu>
|
|
32
32
|
</fieldset>
|
|
33
33
|
<fieldset>
|
|
34
|
-
<legend>${
|
|
35
|
-
<paper-dropdown-menu id="index" label="${
|
|
34
|
+
<legend>${i("appgen.index.help")}</legend>
|
|
35
|
+
<paper-dropdown-menu id="index" label="${i("appgen.index.label")}" name="index">
|
|
36
36
|
<paper-listbox slot="dropdown-content" class="dropdown-content" selected="tei:div" attr-for-selected="value">
|
|
37
|
-
<paper-item value="tei:div">${
|
|
38
|
-
<paper-item value="tei:text">${
|
|
37
|
+
<paper-item value="tei:div">${i("appgen.index.index-div")}</paper-item>
|
|
38
|
+
<paper-item value="tei:text">${i("appgen.index.index-text")}</paper-item>
|
|
39
39
|
</paper-listbox>
|
|
40
40
|
</paper-dropdown-menu>
|
|
41
41
|
</fieldset>
|
|
42
42
|
<fieldset>
|
|
43
|
-
<legend>${
|
|
44
|
-
<paper-input name="owner" required placeholder="${
|
|
45
|
-
label="${
|
|
46
|
-
<paper-input name="password" type="password" required placeholder="${
|
|
47
|
-
label="${
|
|
43
|
+
<legend>${i("appgen.account.user")}</legend>
|
|
44
|
+
<paper-input name="owner" required placeholder="${i("login.user")}"
|
|
45
|
+
label="${i("appgen.account.owner")}" auto-validate></paper-input>
|
|
46
|
+
<paper-input name="password" type="password" required placeholder="${i("login.password")}"
|
|
47
|
+
label="${i("appgen.account.password")}" auto-validate></paper-input>
|
|
48
48
|
</fieldset>
|
|
49
|
-
<paper-button id="submit" @click="${this._doSubmit}"><iron-icon icon="save"></iron-icon> ${
|
|
49
|
+
<paper-button id="submit" @click="${this._doSubmit}"><iron-icon icon="save"></iron-icon> ${i("appgen.submit")}</paper-button>
|
|
50
50
|
</form>
|
|
51
51
|
</iron-form>
|
|
52
52
|
<paper-dialog id="dialog">
|
|
53
|
-
<h2>${
|
|
53
|
+
<h2>${i("appgen.dialog.title")}</h2>
|
|
54
54
|
<div id="dialogContent">
|
|
55
|
-
${this.error?
|
|
56
|
-
<paper-button><iron-icon icon="icons:open-in-new"></iron-icon> ${
|
|
55
|
+
${this.error?p`<div id="error">${this.error}</div>`:p`<a href="${this.url}" target="_blank">
|
|
56
|
+
<paper-button><iron-icon icon="icons:open-in-new"></iron-icon> ${i("appgen.open")}</paper-button>
|
|
57
57
|
</a>
|
|
58
|
-
<p>${
|
|
58
|
+
<p>${i("appgen.success")}</p>`}
|
|
59
59
|
</div>
|
|
60
60
|
<div class="buttons">
|
|
61
|
-
<paper-button dialog-dismiss autofocus>${
|
|
61
|
+
<paper-button dialog-dismiss autofocus>${i("dialogs.close")}</paper-button>
|
|
62
62
|
</div>
|
|
63
63
|
</paper-dialog>
|
|
64
|
-
`}static get styles(){return
|
|
64
|
+
`}static get styles(){return o`
|
|
65
65
|
:host {
|
|
66
66
|
display: block;
|
|
67
67
|
}
|
|
@@ -107,4 +107,4 @@ import{t as e}from"./paper-checkbox-f6a70487.js";import{p as t,L as p,h as o,c a
|
|
|
107
107
|
display: block;
|
|
108
108
|
flex: 1 0;
|
|
109
109
|
}
|
|
110
|
-
`}}customElements.define("pb-edit-app",
|
|
110
|
+
`}}customElements.define("pb-edit-app",a);export{a as PbEditApp};
|
package/dist/pb-elements.json
CHANGED
|
@@ -1875,7 +1875,7 @@
|
|
|
1875
1875
|
{
|
|
1876
1876
|
"name": "pb-code-editor",
|
|
1877
1877
|
"path": "./src/pb-code-editor.js",
|
|
1878
|
-
"description": "A
|
|
1878
|
+
"description": "A code editor based on codemirror 6. Provides a wrapper around\n[@jinntec/jinn-codemirror](https://github.com/JinnElements/jinn-codemirror),\nmainly for backwards compatibility.",
|
|
1879
1879
|
"attributes": [
|
|
1880
1880
|
{
|
|
1881
1881
|
"name": "code",
|
|
@@ -1887,7 +1887,7 @@
|
|
|
1887
1887
|
"name": "mode",
|
|
1888
1888
|
"description": "the language mode e.g. 'javascript' or 'xquery'.",
|
|
1889
1889
|
"type": "string",
|
|
1890
|
-
"default": "\"
|
|
1890
|
+
"default": "\"xml\""
|
|
1891
1891
|
},
|
|
1892
1892
|
{
|
|
1893
1893
|
"name": "placeholder",
|
|
@@ -1912,13 +1912,35 @@
|
|
|
1912
1912
|
"default": "\"\""
|
|
1913
1913
|
},
|
|
1914
1914
|
{
|
|
1915
|
-
"name": "
|
|
1915
|
+
"name": "subscribe",
|
|
1916
|
+
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
1916
1917
|
"type": "string"
|
|
1917
1918
|
},
|
|
1918
1919
|
{
|
|
1919
|
-
"name": "
|
|
1920
|
-
"
|
|
1921
|
-
"
|
|
1920
|
+
"name": "subscribe-config",
|
|
1921
|
+
"description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to listen to.",
|
|
1922
|
+
"type": "object"
|
|
1923
|
+
},
|
|
1924
|
+
{
|
|
1925
|
+
"name": "emit",
|
|
1926
|
+
"description": "The name of the channel to send events to.",
|
|
1927
|
+
"type": "string"
|
|
1928
|
+
},
|
|
1929
|
+
{
|
|
1930
|
+
"name": "emit-config",
|
|
1931
|
+
"description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to be dispatched.",
|
|
1932
|
+
"type": "object"
|
|
1933
|
+
},
|
|
1934
|
+
{
|
|
1935
|
+
"name": "wait-for",
|
|
1936
|
+
"description": "A selector pointing to other components this component depends on.\nWhen method `wait` is called, it will wait until all referenced\ncomponents signal with a `pb-ready` event that they are ready and listening\nto events.",
|
|
1937
|
+
"type": "string"
|
|
1938
|
+
},
|
|
1939
|
+
{
|
|
1940
|
+
"name": "disabled",
|
|
1941
|
+
"description": "Common property to disable the functionality associated with a component.\n`pb-highlight` and `pb-popover` react to this.",
|
|
1942
|
+
"type": "boolean",
|
|
1943
|
+
"default": "false"
|
|
1922
1944
|
}
|
|
1923
1945
|
],
|
|
1924
1946
|
"properties": [
|
|
@@ -1934,7 +1956,7 @@
|
|
|
1934
1956
|
"attribute": "mode",
|
|
1935
1957
|
"description": "the language mode e.g. 'javascript' or 'xquery'.",
|
|
1936
1958
|
"type": "string",
|
|
1937
|
-
"default": "\"
|
|
1959
|
+
"default": "\"xml\""
|
|
1938
1960
|
},
|
|
1939
1961
|
{
|
|
1940
1962
|
"name": "placeholder",
|
|
@@ -1963,23 +1985,46 @@
|
|
|
1963
1985
|
"default": "\"\""
|
|
1964
1986
|
},
|
|
1965
1987
|
{
|
|
1966
|
-
"name": "
|
|
1967
|
-
"attribute": "
|
|
1988
|
+
"name": "subscribe",
|
|
1989
|
+
"attribute": "subscribe",
|
|
1990
|
+
"description": "The name of the channel to subscribe to. Only events on a channel corresponding\nto this property are listened to.",
|
|
1968
1991
|
"type": "string"
|
|
1969
1992
|
},
|
|
1970
1993
|
{
|
|
1971
|
-
"name": "
|
|
1972
|
-
"attribute": "
|
|
1973
|
-
"
|
|
1974
|
-
"
|
|
1994
|
+
"name": "subscribeConfig",
|
|
1995
|
+
"attribute": "subscribe-config",
|
|
1996
|
+
"description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to listen to.",
|
|
1997
|
+
"type": "object"
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
"name": "emit",
|
|
2001
|
+
"attribute": "emit",
|
|
2002
|
+
"description": "The name of the channel to send events to.",
|
|
2003
|
+
"type": "string"
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
"name": "emitConfig",
|
|
2007
|
+
"attribute": "emit-config",
|
|
2008
|
+
"description": "Configuration object to define a channel/event mapping. Every property\nin the object is interpreted as the name of a channel and its value should\nbe an array of event names to be dispatched.",
|
|
2009
|
+
"type": "object"
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
"name": "waitFor",
|
|
2013
|
+
"attribute": "wait-for",
|
|
2014
|
+
"description": "A selector pointing to other components this component depends on.\nWhen method `wait` is called, it will wait until all referenced\ncomponents signal with a `pb-ready` event that they are ready and listening\nto events.",
|
|
2015
|
+
"type": "string"
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
"name": "disabled",
|
|
2019
|
+
"attribute": "disabled",
|
|
2020
|
+
"description": "Common property to disable the functionality associated with a component.\n`pb-highlight` and `pb-popover` react to this.",
|
|
2021
|
+
"type": "boolean",
|
|
2022
|
+
"default": "false"
|
|
1975
2023
|
}
|
|
1976
2024
|
],
|
|
1977
2025
|
"events": [
|
|
1978
2026
|
{
|
|
1979
2027
|
"name": "code-changed"
|
|
1980
|
-
},
|
|
1981
|
-
{
|
|
1982
|
-
"name": "linting-error"
|
|
1983
2028
|
}
|
|
1984
2029
|
]
|
|
1985
2030
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as t,L as e,N as n,A as s}from"./pb-mixin-15ff531f.js";const i=new Map;let a;function r(t){a=t}function o(t){return t instanceof n?t.startNode.isConnected:t instanceof s?t.committer.element.isConnected:t.element.isConnected}function c(){Object.keys(i).forEach(t=>{o(t)||i.delete(t)})}function l(t){"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t)}function d(t,e){const n=e();t.value!==n&&(t.setValue(n),t.commit())}function u(t){a=t.t,i.forEach((t,e)=>{o(e)&&d(e,t)})}function p(t,e){return a?a(t,e):t}const h=t(t=>e=>{i.set(e,t),d(e,t)}),f=(t,e)=>h(()=>p(t,e));document.addEventListener("pb-i18n-update",t=>{u(t.detail)}),setInterval(()=>l(()=>c()),6e4);class b extends e{static get properties(){return Object.assign(Object.assign({},super.properties),{},{key:{type:String},options:{type:Object},_translated:{type:String}})}constructor(){super(),this.key="missing-key",this.options=null,this._translated=null}connectedCallback(){super.connectedCallback(),this._fallback=this.innerHTML,document.addEventListener("pb-i18n-update",this._translate.bind(this)),this._translate()}_translate(){const t=p(this.key,this.options);t&&t!==this.key?this._translated=t:this._translated=null}render(){return this._translated?this._translated:this._fallback}createRenderRoot(){return this}}customElements.define("pb-i18n",b);export{p as g,r as i,f as t};
|