@teipublisher/pb-components 2.26.0-next-3.9 → 2.26.0-next-3.11

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.
@@ -1,4 +1,4 @@
1
- import{p as e,w as t,h as p,c as o,L as i}from"./pb-mixin-b1caa22e.js";import{t as a}from"./pb-i18n-0611135a.js";import"./paper-listbox-9b2edde9.js";import"./paper-checkbox-4f410b1f.js";import"./iron-form-b76df6d4.js";class n extends(e(i)){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"),p=this.shadowRoot.getElementById("defaultView"),o=this.shadowRoot.getElementById("index"),i=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},[]),t("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=p.selectedItem.getAttribute("value");this.request.body["default-view"]=e,this.request.body.index=o.selectedItem.getAttribute("value"),this.request.body.template=i.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`
1
+ import{p as e,w as t,h as p,c as o,L as i}from"./pb-mixin-b1caa22e.js";import{t as a}from"./pb-i18n-0611135a.js";import"./paper-listbox-c2468542.js";import"./paper-checkbox-4f410b1f.js";import"./iron-form-277f9d42.js";class n extends(e(i)){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"),p=this.shadowRoot.getElementById("defaultView"),o=this.shadowRoot.getElementById("index"),i=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},[]),t("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=p.selectedItem.getAttribute("value");this.request.body["default-view"]=e,this.request.body.index=o.selectedItem.getAttribute("value"),this.request.body.template=i.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>
@@ -2587,15 +2587,9 @@
2587
2587
  "path": "./src/pb-collapse.js",
2588
2588
  "description": "A collapsible block: in collapsed state it only shows a header and expands if clicked.\nThe header should go into slot `collapse-trigger`, the content into `collapse-content`.\nExample:\n\n```html\n<pb-collapse>\n <div slot=\"collapse-trigger\">\n Metadata\n </div>\n <pb-view slot=\"collapse-content\" src=\"document1\" subscribe=\"transcription\" xpath=\"//teiHeader\"></pb-view>\n</pb-collapse>\n```\n\nBy adding a CSS 'icon-right' to a `pb-collapse` the icon can be placed on the right side\n```\n<pb-collapse class='icon-right'>\n```",
2589
2589
  "attributes": [
2590
- {
2591
- "name": "horizontal",
2592
- "type": "boolean",
2593
- "default": "false",
2594
- "deprecatedMessage": "Corresponds to the iron-collapse's horizontal property."
2595
- },
2596
2590
  {
2597
2591
  "name": "no-animation",
2598
- "description": "Corresponds to the iron-collapse's noAnimation property.",
2592
+ "description": "Whether to disable animations.",
2599
2593
  "type": "boolean",
2600
2594
  "default": "false"
2601
2595
  },
@@ -2605,24 +2599,6 @@
2605
2599
  "type": "boolean",
2606
2600
  "default": "false"
2607
2601
  },
2608
- {
2609
- "name": "expand-icon",
2610
- "description": "The iron-icon when collapsed. Value must be one of the icons defined by iron-icons",
2611
- "type": "string",
2612
- "default": "\"icons:expand-more\""
2613
- },
2614
- {
2615
- "name": "collapse-icon",
2616
- "description": "The icon when expanded.",
2617
- "type": "string",
2618
- "default": "\"icons:expand-less\""
2619
- },
2620
- {
2621
- "name": "no-icons",
2622
- "description": "Whether to hide the expand/collapse icon.",
2623
- "type": "boolean",
2624
- "default": "false"
2625
- },
2626
2602
  {
2627
2603
  "name": "toggles",
2628
2604
  "description": "By default, an open collapse is closed if another pb-collapse is expanded on the same event channel.\nSet to true to keep multiple pb-collapse open at the same time.",
@@ -2664,15 +2640,13 @@
2664
2640
  "properties": [
2665
2641
  {
2666
2642
  "name": "horizontal",
2667
- "attribute": "horizontal",
2668
2643
  "type": "boolean",
2669
- "default": "false",
2670
- "deprecatedMessage": "Corresponds to the iron-collapse's horizontal property."
2644
+ "default": "false"
2671
2645
  },
2672
2646
  {
2673
2647
  "name": "noAnimation",
2674
2648
  "attribute": "no-animation",
2675
- "description": "Corresponds to the iron-collapse's noAnimation property.",
2649
+ "description": "Whether to disable animations.",
2676
2650
  "type": "boolean",
2677
2651
  "default": "false"
2678
2652
  },
@@ -2685,22 +2659,16 @@
2685
2659
  },
2686
2660
  {
2687
2661
  "name": "expandIcon",
2688
- "attribute": "expand-icon",
2689
- "description": "The iron-icon when collapsed. Value must be one of the icons defined by iron-icons",
2690
2662
  "type": "string",
2691
2663
  "default": "\"icons:expand-more\""
2692
2664
  },
2693
2665
  {
2694
2666
  "name": "collapseIcon",
2695
- "attribute": "collapse-icon",
2696
- "description": "The icon when expanded.",
2697
2667
  "type": "string",
2698
2668
  "default": "\"icons:expand-less\""
2699
2669
  },
2700
2670
  {
2701
2671
  "name": "noIcons",
2702
- "attribute": "no-icons",
2703
- "description": "Whether to hide the expand/collapse icon.",
2704
2672
  "type": "boolean",
2705
2673
  "default": "false"
2706
2674
  },
@@ -2768,8 +2736,17 @@
2768
2736
  "cssProperties": [
2769
2737
  {
2770
2738
  "name": "--pb-collapse-icon-padding",
2771
- "description": "padding in px for the \"caret-down\" icon left to the collapsible item",
2772
- "default": "\"0 4px 0 0\""
2739
+ "description": "padding left or right of the \"caret\" icon left to the collapsible item",
2740
+ "default": "\".5rem\""
2741
+ },
2742
+ {
2743
+ "name": "--pb-collapse-icon-size",
2744
+ "description": "size of the \"caret\" icon left to the collapsible item",
2745
+ "default": "\".75rem\""
2746
+ },
2747
+ {
2748
+ "name": "--pb-collapse-icon-image",
2749
+ "description": "image of the \"caret\" icon left to the collapsible item"
2773
2750
  }
2774
2751
  ]
2775
2752
  },
@@ -11944,6 +11921,11 @@
11944
11921
  "description": "The view type to use for paginating the document. Either `page`, `div` or `single`.\nOverwrites the same property specified on `pb-document`. Values have the following meaning:\n\nValue | Displayed content\n------|------------------\n`page` | content is displayed page by page as determined by tei:pb\n`div` | content is displayed by divisions\n`single` | do not paginate but display entire content at once",
11945
11922
  "type": "string"
11946
11923
  },
11924
+ {
11925
+ "name": "fill",
11926
+ "description": "Controls the pagination-by-div algorithm: if a page would have less than\n`fill` elements, it tries to fill\nup the page by pulling following divs in. When set to 0, it will never\nattempt to fill up the page. For the annotation editor this should\nalways be 0.",
11927
+ "type": "number"
11928
+ },
11947
11929
  {
11948
11930
  "name": "node-id",
11949
11931
  "description": "An eXist nodeId. If specified, selects the root of the fragment of the document\nwhich should be displayed. Normally this property is set automatically by pagination.",
@@ -12053,7 +12035,7 @@
12053
12035
  },
12054
12036
  {
12055
12037
  "name": "no-scroll",
12056
- "description": "If set, do not scroll the view to target node (e.g. given in URL hash) \nafter content was loaded.",
12038
+ "description": "If set, do not scroll the view to target node (e.g. given in URL hash)\nafter content was loaded.",
12057
12039
  "type": "boolean",
12058
12040
  "default": "false"
12059
12041
  },
@@ -12084,7 +12066,7 @@
12084
12066
  },
12085
12067
  {
12086
12068
  "name": "wait-for",
12087
- "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.\n\n`pb-view` by default sets this property to select `pb-toggle-feature` and `pb-select-feature` \nelements.",
12069
+ "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.\n\n`pb-view` by default sets this property to select `pb-toggle-feature` and `pb-select-feature`\nelements.",
12088
12070
  "type": "string"
12089
12071
  },
12090
12072
  {
@@ -12132,6 +12114,12 @@
12132
12114
  "description": "The view type to use for paginating the document. Either `page`, `div` or `single`.\nOverwrites the same property specified on `pb-document`. Values have the following meaning:\n\nValue | Displayed content\n------|------------------\n`page` | content is displayed page by page as determined by tei:pb\n`div` | content is displayed by divisions\n`single` | do not paginate but display entire content at once",
12133
12115
  "type": "string"
12134
12116
  },
12117
+ {
12118
+ "name": "fill",
12119
+ "attribute": "fill",
12120
+ "description": "Controls the pagination-by-div algorithm: if a page would have less than\n`fill` elements, it tries to fill\nup the page by pulling following divs in. When set to 0, it will never\nattempt to fill up the page. For the annotation editor this should\nalways be 0.",
12121
+ "type": "number"
12122
+ },
12135
12123
  {
12136
12124
  "name": "nodeId",
12137
12125
  "attribute": "node-id",
@@ -12267,7 +12255,7 @@
12267
12255
  {
12268
12256
  "name": "noScroll",
12269
12257
  "attribute": "no-scroll",
12270
- "description": "If set, do not scroll the view to target node (e.g. given in URL hash) \nafter content was loaded.",
12258
+ "description": "If set, do not scroll the view to target node (e.g. given in URL hash)\nafter content was loaded.",
12271
12259
  "type": "boolean",
12272
12260
  "default": "false"
12273
12261
  },
@@ -12304,7 +12292,7 @@
12304
12292
  {
12305
12293
  "name": "waitFor",
12306
12294
  "attribute": "wait-for",
12307
- "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.\n\n`pb-view` by default sets this property to select `pb-toggle-feature` and `pb-select-feature` \nelements.",
12295
+ "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.\n\n`pb-view` by default sets this property to select `pb-toggle-feature` and `pb-select-feature`\nelements.",
12308
12296
  "type": "string"
12309
12297
  },
12310
12298
  {
@@ -12441,6 +12429,11 @@
12441
12429
  "description": "The view type to use for paginating the document. Either `page`, `div` or `single`.\nOverwrites the same property specified on `pb-document`. Values have the following meaning:\n\nValue | Displayed content\n------|------------------\n`page` | content is displayed page by page as determined by tei:pb\n`div` | content is displayed by divisions\n`single` | do not paginate but display entire content at once",
12442
12430
  "type": "string"
12443
12431
  },
12432
+ {
12433
+ "name": "fill",
12434
+ "description": "Controls the pagination-by-div algorithm: if a page would have less than\n`fill` elements, it tries to fill\nup the page by pulling following divs in. When set to 0, it will never\nattempt to fill up the page. For the annotation editor this should\nalways be 0.",
12435
+ "type": "number"
12436
+ },
12444
12437
  {
12445
12438
  "name": "node-id",
12446
12439
  "description": "An eXist nodeId. If specified, selects the root of the fragment of the document\nwhich should be displayed. Normally this property is set automatically by pagination.",
@@ -12550,7 +12543,7 @@
12550
12543
  },
12551
12544
  {
12552
12545
  "name": "no-scroll",
12553
- "description": "If set, do not scroll the view to target node (e.g. given in URL hash) \nafter content was loaded.",
12546
+ "description": "If set, do not scroll the view to target node (e.g. given in URL hash)\nafter content was loaded.",
12554
12547
  "type": "boolean",
12555
12548
  "default": "false"
12556
12549
  },
@@ -12581,7 +12574,7 @@
12581
12574
  },
12582
12575
  {
12583
12576
  "name": "wait-for",
12584
- "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.\n\n`pb-view` by default sets this property to select `pb-toggle-feature` and `pb-select-feature` \nelements.",
12577
+ "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.\n\n`pb-view` by default sets this property to select `pb-toggle-feature` and `pb-select-feature`\nelements.",
12585
12578
  "type": "string"
12586
12579
  },
12587
12580
  {
@@ -12604,6 +12597,12 @@
12604
12597
  "description": "The view type to use for paginating the document. Either `page`, `div` or `single`.\nOverwrites the same property specified on `pb-document`. Values have the following meaning:\n\nValue | Displayed content\n------|------------------\n`page` | content is displayed page by page as determined by tei:pb\n`div` | content is displayed by divisions\n`single` | do not paginate but display entire content at once",
12605
12598
  "type": "string"
12606
12599
  },
12600
+ {
12601
+ "name": "fill",
12602
+ "attribute": "fill",
12603
+ "description": "Controls the pagination-by-div algorithm: if a page would have less than\n`fill` elements, it tries to fill\nup the page by pulling following divs in. When set to 0, it will never\nattempt to fill up the page. For the annotation editor this should\nalways be 0.",
12604
+ "type": "number"
12605
+ },
12607
12606
  {
12608
12607
  "name": "nodeId",
12609
12608
  "attribute": "node-id",
@@ -12739,7 +12738,7 @@
12739
12738
  {
12740
12739
  "name": "noScroll",
12741
12740
  "attribute": "no-scroll",
12742
- "description": "If set, do not scroll the view to target node (e.g. given in URL hash) \nafter content was loaded.",
12741
+ "description": "If set, do not scroll the view to target node (e.g. given in URL hash)\nafter content was loaded.",
12743
12742
  "type": "boolean",
12744
12743
  "default": "false"
12745
12744
  },
@@ -12776,7 +12775,7 @@
12776
12775
  {
12777
12776
  "name": "waitFor",
12778
12777
  "attribute": "wait-for",
12779
- "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.\n\n`pb-view` by default sets this property to select `pb-toggle-feature` and `pb-select-feature` \nelements.",
12778
+ "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.\n\n`pb-view` by default sets this property to select `pb-toggle-feature` and `pb-select-feature`\nelements.",
12780
12779
  "type": "string"
12781
12780
  },
12782
12781
  {