@teipublisher/pb-components 2.26.1-next.3 → 3.0.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 (154) hide show
  1. package/.github/workflows/main.yml +3 -3
  2. package/.github/workflows/node.js.yml +3 -3
  3. package/.github/workflows/release.js.yml +4 -4
  4. package/.releaserc.json +2 -2
  5. package/CHANGELOG.md +262 -11
  6. package/Dockerfile +78 -70
  7. package/css/components.css +5 -5
  8. package/css/leaflet/images/layers.png +0 -0
  9. package/dist/demo/components.css +46 -1
  10. package/dist/demo/pb-browse-docs2.html +1 -1
  11. package/dist/demo/pb-dialog.html +3 -5
  12. package/dist/demo/pb-drawer2.html +1 -1
  13. package/dist/demo/pb-facsimile.html +2 -2
  14. package/dist/demo/pb-grid.html +19 -6
  15. package/dist/demo/pb-leaflet-map.html +1 -1
  16. package/dist/demo/pb-login.html +0 -2
  17. package/dist/demo/pb-message.html +1 -2
  18. package/dist/demo/pb-progress.html +2 -2
  19. package/dist/demo/pb-repeat.html +1 -3
  20. package/dist/demo/pb-search.html +7 -4
  21. package/dist/demo/pb-search3.html +1 -1
  22. package/dist/demo/pb-search4.html +2 -2
  23. package/dist/demo/pb-view3.html +1 -1
  24. package/dist/{iron-form-3b8dcaa7.js → iron-form-dfb3e3b1.js} +95 -95
  25. package/dist/paper-checkbox-645e1077.js +200 -0
  26. package/dist/{paper-icon-button-b1d31571.js → paper-icon-button-984162bd.js} +1 -1
  27. package/dist/{paper-checkbox-515a5284.js → paper-inky-focus-behavior-fa16796b.js} +58 -247
  28. package/dist/{paper-listbox-a3b7175c.js → paper-listbox-5f5d1cec.js} +152 -162
  29. package/dist/pb-code-editor.js +25 -20
  30. package/dist/pb-component-docs.js +68 -64
  31. package/dist/pb-components-bundle.js +1983 -2293
  32. package/dist/pb-edit-app.js +167 -107
  33. package/dist/pb-elements.json +176 -120
  34. package/dist/{pb-i18n-0611135a.js → pb-i18n-4cc00bfe.js} +1 -1
  35. package/dist/pb-leaflet-map.js +23 -23
  36. package/dist/pb-mei.js +56 -41
  37. package/dist/{pb-mixin-b1caa22e.js → pb-mixin-886ece32.js} +1 -1
  38. package/dist/pb-odd-editor.js +1023 -782
  39. package/dist/pb-tify.js +2 -2
  40. package/dist/vaadin-element-mixin-beb74ffd.js +545 -0
  41. package/gh-pages.js +5 -3
  42. package/i18n/common/en.json +6 -0
  43. package/i18n/common/pl.json +2 -2
  44. package/lib/openseadragon.min.js +6 -6
  45. package/package.json +3 -3
  46. package/pb-elements.json +176 -120
  47. package/src/assets/components.css +5 -5
  48. package/src/authority/airtable.js +20 -21
  49. package/src/authority/anton.js +129 -129
  50. package/src/authority/custom.js +23 -21
  51. package/src/authority/geonames.js +38 -32
  52. package/src/authority/gnd.js +50 -42
  53. package/src/authority/kbga.js +137 -134
  54. package/src/authority/metagrid.js +44 -46
  55. package/src/authority/reconciliation.js +66 -67
  56. package/src/authority/registry.js +4 -4
  57. package/src/docs/pb-component-docs.js +2 -2
  58. package/src/docs/pb-component-view.js +5 -5
  59. package/src/docs/pb-components-list.js +2 -2
  60. package/src/docs/pb-demo-snippet.js +2 -2
  61. package/src/dts-client.js +299 -297
  62. package/src/dts-select-endpoint.js +90 -82
  63. package/src/parse-date-service.js +184 -135
  64. package/src/pb-ajax.js +158 -171
  65. package/src/pb-authority-lookup.js +191 -156
  66. package/src/pb-autocomplete.js +292 -280
  67. package/src/pb-blacklab-highlight.js +264 -259
  68. package/src/pb-blacklab-results.js +236 -221
  69. package/src/pb-browse-docs.js +540 -475
  70. package/src/pb-browse.js +68 -65
  71. package/src/pb-clipboard.js +79 -76
  72. package/src/pb-code-editor.js +110 -102
  73. package/src/pb-code-highlight.js +209 -204
  74. package/src/pb-codepen.js +79 -72
  75. package/src/pb-collapse.js +211 -151
  76. package/src/pb-combo-box.js +190 -190
  77. package/src/pb-components-bundle.js +1 -1
  78. package/src/pb-components.js +1 -0
  79. package/src/pb-custom-form.js +173 -153
  80. package/src/pb-dialog.js +98 -62
  81. package/src/pb-document.js +89 -90
  82. package/src/pb-download.js +212 -196
  83. package/src/pb-drawer.js +145 -148
  84. package/src/pb-edit-app.js +301 -229
  85. package/src/pb-edit-xml.js +100 -97
  86. package/src/pb-events.js +114 -107
  87. package/src/pb-facs-link.js +104 -102
  88. package/src/pb-facsimile.js +474 -410
  89. package/src/pb-formula.js +151 -153
  90. package/src/pb-geolocation.js +129 -131
  91. package/src/pb-grid-action.js +53 -56
  92. package/src/pb-grid.js +231 -228
  93. package/src/pb-highlight.js +140 -140
  94. package/src/pb-hotkeys.js +40 -42
  95. package/src/pb-i18n.js +101 -104
  96. package/src/pb-image-strip.js +84 -78
  97. package/src/pb-lang.js +142 -57
  98. package/src/pb-leaflet-map.js +488 -485
  99. package/src/pb-link.js +126 -124
  100. package/src/pb-load.js +431 -429
  101. package/src/pb-login.js +299 -244
  102. package/src/pb-manage-odds.js +352 -336
  103. package/src/pb-map-icon.js +89 -89
  104. package/src/pb-map-layer.js +85 -85
  105. package/src/pb-markdown.js +90 -99
  106. package/src/pb-media-query.js +74 -72
  107. package/src/pb-mei.js +306 -295
  108. package/src/pb-message.js +139 -97
  109. package/src/pb-mixin.js +269 -264
  110. package/src/pb-navigation.js +80 -95
  111. package/src/pb-observable.js +38 -38
  112. package/src/pb-odd-editor.js +1054 -958
  113. package/src/pb-odd-elementspec-editor.js +349 -298
  114. package/src/pb-odd-model-editor.js +1075 -909
  115. package/src/pb-odd-parameter-editor.js +200 -178
  116. package/src/pb-odd-rendition-editor.js +136 -124
  117. package/src/pb-page.js +431 -422
  118. package/src/pb-paginate.js +228 -179
  119. package/src/pb-panel.js +198 -182
  120. package/src/pb-popover-themes.js +15 -8
  121. package/src/pb-popover.js +296 -287
  122. package/src/pb-print-preview.js +127 -127
  123. package/src/pb-progress.js +51 -51
  124. package/src/pb-repeat.js +105 -104
  125. package/src/pb-restricted.js +84 -77
  126. package/src/pb-search.js +256 -228
  127. package/src/pb-select-feature.js +127 -120
  128. package/src/pb-select-odd.js +132 -124
  129. package/src/pb-select-template.js +89 -78
  130. package/src/pb-select.js +251 -227
  131. package/src/pb-split-list.js +179 -174
  132. package/src/pb-svg.js +80 -79
  133. package/src/pb-table-column.js +54 -54
  134. package/src/pb-table-grid.js +221 -203
  135. package/src/pb-tabs.js +61 -63
  136. package/src/pb-tify.js +154 -154
  137. package/src/pb-timeline.js +382 -249
  138. package/src/pb-toggle-feature.js +195 -187
  139. package/src/pb-upload.js +184 -174
  140. package/src/pb-version.js +30 -30
  141. package/src/pb-view-annotate.js +135 -98
  142. package/src/pb-view.js +1282 -1270
  143. package/src/pb-zoom.js +127 -45
  144. package/src/polymer-hack.js +1 -1
  145. package/src/search-result-service.js +256 -223
  146. package/src/seed-element.js +13 -20
  147. package/src/settings.js +4 -4
  148. package/src/theming.js +98 -91
  149. package/src/urls.js +289 -289
  150. package/src/utils.js +53 -51
  151. package/css/pb-styles.css +0 -51
  152. package/dist/vaadin-element-mixin-fe4a4883.js +0 -527
  153. package/src/assets/pb-styles.css +0 -51
  154. package/src/pb-light-dom.js +0 -41
@@ -13,16 +13,15 @@ import '@polymer/paper-dropdown-menu/paper-dropdown-menu.js';
13
13
  import '@polymer/paper-listbox/paper-listbox.js';
14
14
  import '@polymer/paper-item/paper-item.js';
15
15
  import '@polymer/paper-styles/color.js';
16
- import '@polymer/iron-collapse/iron-collapse.js';
17
- import "@jinntec/jinn-codemirror/dist/src/jinn-codemirror";
16
+
17
+ import '@jinntec/jinn-codemirror/dist/src/jinn-codemirror';
18
18
 
19
19
  import { cmpVersion } from './utils.js';
20
20
  import './pb-odd-rendition-editor.js';
21
21
  import './pb-odd-parameter-editor.js';
22
22
  import './pb-message.js';
23
23
 
24
- import { get as i18n, translate } from "./pb-i18n.js";
25
-
24
+ import { get as i18n, translate } from './pb-i18n.js';
26
25
 
27
26
  /**
28
27
  * represents an odd model element for editing
@@ -32,436 +31,464 @@ import { get as i18n, translate } from "./pb-i18n.js";
32
31
  * @polymer
33
32
  */
34
33
  export class PbOddModelEditor extends LitElement {
35
-
36
- static get styles() {
37
- return css`
38
- :host {
39
- display: flex;
40
- flex-direction:column;
41
- }
42
- h1, h2, h3, h4, h5, h6 {
43
- font-family: "Oswald", Verdana, "Helvetica", sans-serif;
44
- font-weight: 400 !important;
45
- }
46
-
47
- form {
48
- margin-bottom: 8px;
49
- }
50
-
51
- paper-input, paper-autocomplete {
52
- margin-bottom: 16px;
53
- }
54
-
55
- .models {
56
- margin-left:20px;
57
- margin-top:10px;
58
- }
59
-
60
- .btn, .btn-group {
61
- margin-top: 0;
62
- margin-bottom: 0;
63
- }
64
-
65
- header {
66
- // background-color: #d1dae0;
67
- background:var(--paper-grey-300);
68
- margin:0;
69
- }
70
-
71
- header div {
72
- display: flex;
73
- flex-direction: row;
74
- justify-content: space-between;
75
- align-items: center;
76
- }
77
-
78
- header h4 {
79
- padding: 4px 8px;
80
- margin: 0;
81
- display: grid;
82
- grid-template-columns: 40px 40% auto;
83
- }
84
- h4 .btn-group{
85
- text-align: right;
86
- display: none;
87
- }
88
-
89
- #toggle, .modelType{
90
- align-self:center;
91
- }
92
-
93
- header div.info {
94
- padding: 0 16px 4px;
95
- margin: 0;
96
- font-size: 85%;
97
- display: block;
98
- margin:0 0 0 32px;
99
- }
100
- header div.info *{
101
- display: block;
102
- line-height: 1.2;
103
- }
104
-
105
- header .outputDisplay{
106
- text-transform: uppercase ;
107
- }
108
- header .description{
109
- font-style: italic;
110
- }
111
-
112
- header .predicate {
113
- color: #ff5722;
114
- }
115
-
116
- .predicate label, .template label {
117
- display: block;
118
- font-size: 12px;
119
- font-weight: 300;
120
- color: rgb(115, 115, 115);
121
- }
122
-
123
- .model-collapse {
124
- color: #000000;
125
- cursor: pointer;
126
- }
127
-
128
- .model-collapse:hover {
129
- text-decoration: none;
130
- }
131
-
132
- .behaviour {
133
- color: #ff5722;
134
- }
135
-
136
- .behaviour:before {
137
- content: ' [';
138
- }
139
-
140
- .behaviour:after {
141
- content: ']';
142
- }
143
-
144
- .behaviourWrapper{
145
- display:grid;
146
- grid-template-columns: 140px 40px 140px auto;
147
- }
148
- .behaviourWrapper > *{
149
- display:inline;
150
- align-self:stretch;
151
- }
152
-
153
- .group {
154
- margin: 0;
155
- font-size: 16px;
156
- font-weight: bold;
157
- }
158
-
159
- .group .title {
160
- /*text-decoration: underline;*/
161
- }
162
-
163
- .renditions, .parameters {
164
- padding-left: 16px;
165
- border-left: 3px solid #e0e0e0;
166
- margin-bottom:20px;
167
- }
168
-
169
- .renditions .group {
170
- display: flex;
171
- flex-direction: row;
172
- justify-content: space-between;
173
- align-items: center;
174
- }
175
-
176
- .predicate .form-control {
177
- width: 100%;
178
- }
179
-
180
- .source {
181
- text-decoration: none;
182
- margin-bottom: 8px;
183
- }
184
-
185
- .selectOutput {
186
- margin-right: 10px;
187
- }
188
-
189
- :host([currentselection]) > form > header{
190
- @apply --shadow-elevation-4dp;
191
- border-left:3px solid var(--paper-blue-500);
192
- }
193
-
194
- paper-menu-button paper-icon-button{
195
- margin-left:-10px;
196
- }
197
-
198
- /* need to play it save for FF */
199
- :host([currentselection]) > form > header > h4 > .btn-group{
200
- display: inline-block;
201
- }
202
- iron-collapse{
203
- }
204
-
205
- .renditions{
206
- margin-top:10px;
207
- }
208
-
209
- .details{
210
- padding:0px 50px 20px 20px;
211
- background:var(--paper-grey-200);
212
- }
213
-
214
- .editor {
215
- margin-bottom: 20px;
216
- }
217
-
218
- .editor label {
219
- margin-bottom:5px;
220
- font-size: 12px;
221
- font-weight: 400;
222
- color: var(--paper-grey-500);
223
- }
224
-
225
- .horizontal {
226
- display: flex;
227
- flex-wrap: wrap;
228
- justify-content: space-between;
229
- }
230
-
231
- #mode {
232
- min-width: 18em;
233
- }
234
- `;
235
- }
236
-
237
- static get properties() {
238
- return {
239
- /**
240
- * maps to ODD ´model` behaviour attribute
241
- */
242
- behaviour: {
243
- type: String
244
- },
245
- /**
246
- * maps to ODD `model` predicate
247
- */
248
- predicate: {
249
- type: String,
250
- reflect: true,
251
- converter: (value, type) => {
252
- if (value.toLowerCase() === 'null') {
253
- return '';
254
- }
255
- return value;
256
- }
257
- },
258
- type: {
259
- type: String,
260
- reflect: true
261
- },
262
- template: {
263
- type: String,
264
- reflect: true,
265
- converter: (value, type) => {
266
- if (value.toLowerCase() === 'null') {
267
- return '';
268
- }
269
- return value;
270
- }
271
- },
272
- output: {
273
- type: String,
274
- reflect: true,
275
- converter: (value, type) => {
276
- if (value.toLowerCase() === 'null') {
277
- return '';
278
- }
279
- return value;
280
- }
281
- },
282
- css: {
283
- type: String,
284
- converter: (value, type) => {
285
- if (value.toLowerCase() === 'null') {
286
- return '';
287
- }
288
- return value;
289
- }
290
- },
291
- mode: {
292
- type: String
293
- },
294
- model: {
295
- type: Object
296
- },
297
- models: {
298
- type: Array
299
- },
300
- parameters: {
301
- type: Array
302
- },
303
- renditions: {
304
- type: Array
305
- },
306
- desc: {
307
- type: String,
308
- converter: (value, type) => {
309
- if (value.toLowerCase() === 'null') {
310
- return '';
311
- }
312
- return value;
313
- }
314
- },
315
- sourcerend: {
316
- type: String
317
- },
318
- show: {
319
- type: Boolean,
320
- reflect: true
321
- },
322
- outputs: {
323
- type: Array
324
- },
325
- behaviours: {
326
- type: Array
327
- },
328
- icon: {
329
- type: String
330
- },
331
- open: {
332
- type: String
333
- },
334
- hasCustomBehaviour: {
335
- type: Boolean
336
- },
337
- endpoint: {
338
- type: String
339
- },
340
- apiVersion: {
341
- type: String
342
- }
343
- };
344
- }
345
-
346
- constructor() {
347
- super();
348
- this.behaviour = 'inline';
349
- this.predicate = '';
350
- this.type = '';
351
- this.template = '';
352
- this.output = '';
353
- this.css = '';
354
- this.mode = '';
355
- this.model = {};
356
- this.model.models = [];
357
- this.parameters = [];
358
- this.renditions = [];
359
- this.desc = '';
360
- this.sourcerend = '';
361
- this.show = false;
362
-
363
- this.outputs = ["",
364
- "web",
365
- "print",
366
- "epub",
367
- "fo",
368
- "latex",
369
- "plain"];
370
-
371
- this.parentModel = [];
372
- this.behaviours = [
373
- "alternate",
374
- "anchor",
375
- "block",
376
- "body",
377
- "break",
378
- "cell",
379
- "cit",
380
- "document",
381
- "figure",
382
- "graphic",
383
- "heading",
384
- "inline",
385
- "link",
386
- "list",
387
- "listItem",
388
- "metadata",
389
- "note",
390
- "omit",
391
- "paragraph",
392
- "pass-through",
393
- "row",
394
- "section",
395
- "table",
396
- "text",
397
- "title",
398
- "webcomponent"
399
- ];
400
-
401
- this.icon = 'expand-more';
402
- this.hasCustomBehaviour = false;
34
+ static get styles() {
35
+ return css`
36
+ :host {
37
+ display: flex;
38
+ flex-direction: column;
39
+ }
40
+ h1,
41
+ h2,
42
+ h3,
43
+ h4,
44
+ h5,
45
+ h6 {
46
+ font-family: 'Oswald', Verdana, 'Helvetica', sans-serif;
47
+ font-weight: 400 !important;
48
+ }
49
+
50
+ form {
51
+ margin-bottom: 8px;
52
+ }
53
+
54
+ paper-input,
55
+ paper-autocomplete {
56
+ margin-bottom: 16px;
57
+ }
58
+
59
+ .models {
60
+ margin-left: 20px;
61
+ margin-top: 10px;
62
+ }
63
+
64
+ .btn,
65
+ .btn-group {
66
+ margin-top: 0;
67
+ margin-bottom: 0;
68
+ }
69
+
70
+ header {
71
+ // background-color: #d1dae0;
72
+ background: var(--paper-grey-300);
73
+ margin: 0;
74
+ }
75
+
76
+ header div {
77
+ display: flex;
78
+ flex-direction: row;
79
+ justify-content: space-between;
80
+ align-items: center;
81
+ }
82
+
83
+ header h4 {
84
+ padding: 4px 8px;
85
+ margin: 0;
86
+ display: grid;
87
+ grid-template-columns: 40px 40% auto;
88
+ }
89
+ h4 .btn-group {
90
+ text-align: right;
91
+ display: none;
92
+ }
93
+
94
+ #toggle,
95
+ .modelType {
96
+ align-self: center;
97
+ }
98
+
99
+ header div.info {
100
+ padding: 0 16px 4px;
101
+ margin: 0;
102
+ font-size: 85%;
103
+ display: block;
104
+ margin: 0 0 0 32px;
105
+ }
106
+ header div.info * {
107
+ display: block;
108
+ line-height: 1.2;
109
+ }
110
+
111
+ header .outputDisplay {
112
+ text-transform: uppercase;
113
+ }
114
+ header .description {
115
+ font-style: italic;
116
+ }
117
+
118
+ header .predicate {
119
+ color: #ff5722;
120
+ }
121
+
122
+ .predicate label,
123
+ .template label {
124
+ display: block;
125
+ font-size: 12px;
126
+ font-weight: 300;
127
+ color: rgb(115, 115, 115);
128
+ }
129
+
130
+ .model-collapse {
131
+ color: #000000;
132
+ cursor: pointer;
133
+ }
134
+
135
+ .model-collapse:hover {
136
+ text-decoration: none;
137
+ }
138
+
139
+ .behaviour {
140
+ color: #ff5722;
141
+ }
142
+
143
+ .behaviour:before {
144
+ content: ' [';
145
+ }
146
+
147
+ .behaviour:after {
148
+ content: ']';
149
+ }
150
+
151
+ .behaviourWrapper {
152
+ display: grid;
153
+ grid-template-columns: 140px 40px 140px auto;
154
+ }
155
+ .behaviourWrapper > * {
156
+ display: inline;
157
+ align-self: stretch;
158
+ }
159
+
160
+ .group {
161
+ margin: 0;
162
+ font-size: 16px;
163
+ font-weight: bold;
164
+ }
165
+
166
+ .group .title {
167
+ /*text-decoration: underline;*/
168
+ }
169
+
170
+ .renditions,
171
+ .parameters {
172
+ padding-left: 16px;
173
+ border-left: 3px solid #e0e0e0;
174
+ margin-bottom: 20px;
175
+ }
176
+
177
+ .renditions .group {
178
+ display: flex;
179
+ flex-direction: row;
180
+ justify-content: space-between;
181
+ align-items: center;
182
+ }
183
+
184
+ .predicate .form-control {
185
+ width: 100%;
186
+ }
187
+
188
+ .source {
189
+ text-decoration: none;
190
+ margin-bottom: 8px;
191
+ }
192
+
193
+ .selectOutput {
194
+ margin-right: 10px;
195
+ }
196
+
197
+ :host([currentselection]) > form > header {
198
+ @apply --shadow-elevation-4dp;
199
+ border-left: 3px solid var(--paper-blue-500);
200
+ }
201
+
202
+ paper-menu-button paper-icon-button {
203
+ margin-left: -10px;
204
+ }
205
+
206
+ /* need to play it save for FF */
207
+ :host([currentselection]) > form > header > h4 > .btn-group {
208
+ display: inline-block;
209
+ }
210
+ details {
211
+ display: block;
212
+ }
213
+
214
+ details summary {
215
+ display: none;
216
+ }
217
+
218
+ .renditions {
219
+ margin-top: 10px;
220
+ }
221
+
222
+ .details {
223
+ padding: 0px 50px 20px 20px;
224
+ background: var(--paper-grey-200);
225
+ }
226
+
227
+ details:not([open]) {
228
+ padding: 0;
229
+ }
230
+
231
+ .editor label {
232
+ margin-bottom: 5px;
233
+ font-size: 12px;
234
+ font-weight: 400;
235
+ color: var(--paper-grey-500);
236
+ }
237
+
238
+ .horizontal {
239
+ display: flex;
240
+ flex-wrap: wrap;
241
+ justify-content: space-between;
242
+ }
243
+
244
+ #mode {
245
+ min-width: 18em;
246
+ }
247
+ `;
248
+ }
249
+
250
+ static get properties() {
251
+ return {
252
+ /**
253
+ * maps to ODD ´model` behaviour attribute
254
+ */
255
+ behaviour: {
256
+ type: String,
257
+ },
258
+ /**
259
+ * maps to ODD `model` predicate
260
+ */
261
+ predicate: {
262
+ type: String,
263
+ reflect: true,
264
+ converter: (value, type) => {
265
+ if (value.toLowerCase() === 'null') {
266
+ return '';
267
+ }
268
+ return value;
269
+ },
270
+ },
271
+ type: {
272
+ type: String,
273
+ reflect: true,
274
+ },
275
+ template: {
276
+ type: String,
277
+ reflect: true,
278
+ converter: (value, type) => {
279
+ if (value.toLowerCase() === 'null') {
280
+ return '';
281
+ }
282
+ return value;
283
+ },
284
+ },
285
+ output: {
286
+ type: String,
287
+ reflect: true,
288
+ converter: (value, type) => {
289
+ if (value.toLowerCase() === 'null') {
290
+ return '';
291
+ }
292
+ return value;
293
+ },
294
+ },
295
+ css: {
296
+ type: String,
297
+ converter: (value, type) => {
298
+ if (value.toLowerCase() === 'null') {
299
+ return '';
300
+ }
301
+ return value;
302
+ },
303
+ },
304
+ mode: {
305
+ type: String,
306
+ },
307
+ model: {
308
+ type: Object,
309
+ },
310
+ models: {
311
+ type: Array,
312
+ },
313
+ parameters: {
314
+ type: Array,
315
+ },
316
+ renditions: {
317
+ type: Array,
318
+ },
319
+ desc: {
320
+ type: String,
321
+ converter: (value, type) => {
322
+ if (value.toLowerCase() === 'null') {
323
+ return '';
324
+ }
325
+ return value;
326
+ },
327
+ },
328
+ sourcerend: {
329
+ type: String,
330
+ },
331
+ show: {
332
+ type: Boolean,
333
+ reflect: true,
334
+ },
335
+ outputs: {
336
+ type: Array,
337
+ },
338
+ behaviours: {
339
+ type: Array,
340
+ },
341
+ icon: {
342
+ type: String,
343
+ },
344
+ open: {
345
+ type: String,
346
+ },
347
+ hasCustomBehaviour: {
348
+ type: Boolean,
349
+ },
350
+ endpoint: {
351
+ type: String,
352
+ },
353
+ apiVersion: {
354
+ type: String,
355
+ },
356
+ };
357
+ }
358
+
359
+ constructor() {
360
+ super();
361
+ this.behaviour = 'inline';
362
+ this.predicate = '';
363
+ this.type = '';
364
+ this.template = '';
365
+ this.output = '';
366
+ this.css = '';
367
+ this.mode = '';
368
+ this.model = {};
369
+ this.model.models = [];
370
+ this.parameters = [];
371
+ this.renditions = [];
372
+ this.desc = '';
373
+ this.sourcerend = '';
374
+ this.show = false;
375
+
376
+ this.outputs = ['', 'web', 'print', 'epub', 'fo', 'latex', 'plain'];
377
+
378
+ this.parentModel = [];
379
+ this.behaviours = [
380
+ 'alternate',
381
+ 'anchor',
382
+ 'block',
383
+ 'body',
384
+ 'break',
385
+ 'cell',
386
+ 'cit',
387
+ 'document',
388
+ 'figure',
389
+ 'graphic',
390
+ 'heading',
391
+ 'inline',
392
+ 'link',
393
+ 'list',
394
+ 'listItem',
395
+ 'metadata',
396
+ 'note',
397
+ 'omit',
398
+ 'paragraph',
399
+ 'pass-through',
400
+ 'row',
401
+ 'section',
402
+ 'table',
403
+ 'text',
404
+ 'title',
405
+ 'webcomponent',
406
+ ];
407
+
408
+ this.icon = 'expand-more';
409
+ this.hasCustomBehaviour = false;
410
+ }
411
+
412
+ render() {
413
+ let tmplSyntax;
414
+ switch (this.output) {
415
+ case 'web':
416
+ case 'epub':
417
+ tmplSyntax = 'html';
418
+ break;
419
+ case 'latex':
420
+ tmplSyntax = 'tex';
421
+ break;
422
+ case 'plain':
423
+ tmplSyntax = 'default';
424
+ break;
425
+ case 'fo':
426
+ case 'print':
427
+ tmplSyntax = 'xml';
428
+ break;
429
+ default:
430
+ tmplSyntax = 'html';
431
+ break;
403
432
  }
404
-
405
- render() {
406
- let tmplSyntax;
407
- switch (this.output) {
408
- case 'web':
409
- case 'epub':
410
- tmplSyntax = 'html';
411
- break;
412
- case 'latex':
413
- tmplSyntax = 'tex';
414
- break;
415
- case 'plain':
416
- tmplSyntax = 'default';
417
- break;
418
- case 'fo':
419
- case 'print':
420
- tmplSyntax = 'xml';
421
- break;
422
- default:
423
- tmplSyntax = 'html';
424
- break;
425
- }
426
- return html`
433
+ return html`
427
434
  <form>
428
- <header>
435
+ <header>
429
436
  <h4>
430
437
  <paper-icon-button id="toggle"
431
438
  icon="${this.icon}" @click="${this.toggle}"
432
439
  class="model-collapse"></paper-icon-button>
433
-
434
- <span class="modelType">${this.type}<span class="behaviour" ?hidden="${this._isGroupOrSequence()}">${this.behaviour}</span></span>
440
+
441
+ <span class="modelType">${
442
+ this.type
443
+ }<span class="behaviour" ?hidden="${this._isGroupOrSequence()}">${
444
+ this.behaviour
445
+ }</span></span>
435
446
 
436
447
  <span class="btn-group">
437
448
  <paper-icon-button @click="${this._moveDown}" icon="arrow-downward"
438
449
  title="move down"></paper-icon-button>
439
450
  <paper-icon-button @click="${this._moveUp}" icon="arrow-upward"
440
451
  title="move up"></paper-icon-button>
441
- <paper-icon-button @click="${this._requestRemoval}" icon="delete" title="remove"></paper-icon-button>
442
- <paper-icon-button @click="${this._copy}" icon="content-copy" title="copy"></paper-icon-button>
443
- <paper-icon-button @click="${this._paste}" icon="content-paste"></paper-icon-button>
444
-
445
- ${this._isGroupOrSequence() ?
446
- html`
447
- <paper-menu-button horizontal-align="right">
448
- <paper-icon-button icon="add" slot="dropdown-trigger"></paper-icon-button>
449
- <paper-listbox id="modelType" slot="dropdown-content" @iron-select="${this._addNested}"
450
- attr-for-selected="value">
451
- ${this.type === 'modelSequence' ?
452
- html`
453
- <paper-item value="model">model</paper-item>
454
- `: ''
455
- }
456
- ${this.type === 'modelGrp' ?
457
- html`
458
- <paper-item value="modelSequence">modelSequence</paper-item>
459
- <paper-item value="model">model</paper-item>
460
- `: ''
461
- }
462
- </paper-listbox>
463
- </paper-menu-button>
464
- `: ''}
452
+ <paper-icon-button @click="${
453
+ this._requestRemoval
454
+ }" icon="delete" title="remove"></paper-icon-button>
455
+ <paper-icon-button @click="${
456
+ this._copy
457
+ }" icon="content-copy" title="copy"></paper-icon-button>
458
+ <paper-icon-button @click="${
459
+ this._paste
460
+ }" icon="content-paste"></paper-icon-button>
461
+
462
+ ${
463
+ this._isGroupOrSequence()
464
+ ? html`
465
+ <paper-menu-button horizontal-align="right">
466
+ <paper-icon-button
467
+ icon="add"
468
+ slot="dropdown-trigger"
469
+ ></paper-icon-button>
470
+ <paper-listbox
471
+ id="modelType"
472
+ slot="dropdown-content"
473
+ @iron-select="${this._addNested}"
474
+ attr-for-selected="value"
475
+ >
476
+ ${this.type === 'modelSequence'
477
+ ? html` <paper-item value="model">model</paper-item> `
478
+ : ''}
479
+ ${this.type === 'modelGrp'
480
+ ? html`
481
+ <paper-item value="modelSequence"
482
+ >modelSequence</paper-item
483
+ >
484
+ <paper-item value="model">model</paper-item>
485
+ `
486
+ : ''}
487
+ </paper-listbox>
488
+ </paper-menu-button>
489
+ `
490
+ : ''
491
+ }
465
492
  </span>
466
493
  </h4>
467
494
  <div class="info">
@@ -470,16 +497,16 @@ export class PbOddModelEditor extends LitElement {
470
497
  <div class="predicate">${this.predicate}</div>
471
498
  </p>
472
499
  </header>
473
- <iron-collapse id="details" ?opened="${this.show}" class="details">
500
+ <details ?open="${this.show}" class="details">
501
+ <summary style="display: none;"></summary>
474
502
  <div class="horizontal">
475
503
  <paper-dropdown-menu class="selectOutput" label="Output">
476
504
  <paper-listbox id="output" slot="dropdown-content" attr-for-selected="value"
477
505
  selected="${this.output}" @iron-select="${this._selectOutput}">
478
506
 
479
- ${this.outputs.map((item) =>
480
- html`
481
- <paper-item value="${item}">${item}</paper-item>
482
- `)}
507
+ ${this.outputs.map(
508
+ item => html` <paper-item value="${item}">${item}</paper-item> `,
509
+ )}
483
510
 
484
511
  </paper-listbox>
485
512
  </paper-dropdown-menu>
@@ -488,530 +515,669 @@ export class PbOddModelEditor extends LitElement {
488
515
  label="Mode"
489
516
  @change="${this._inputMode}"></paper-input>
490
517
  </div>
491
- <paper-input id="desc" .value="${this.desc}" placeholder="${translate('odd.editor.model.description-placeholder')}"
518
+ <paper-input id="desc" .value="${this.desc}" placeholder="${translate(
519
+ 'odd.editor.model.description-placeholder',
520
+ )}"
492
521
  label="Description" @change="${this._inputDesc}"></paper-input>
493
522
 
494
523
  <div class="editor">
495
524
  <label>Predicate</label>
496
525
  <jinn-codemirror id="predicate"
497
- code="${this.predicate}"
526
+ code="${this.predicate}"
498
527
  mode="xquery"
499
- linter="${this.endpoint}/${cmpVersion(this.apiVersion, '1.0.0') < 0 ? 'modules/editor.xql' : 'api/lint'}"
528
+ linter="${this.endpoint}/${
529
+ cmpVersion(this.apiVersion, '1.0.0') < 0 ? 'modules/editor.xql' : 'api/lint'
530
+ }"
500
531
  placeholder="${translate('odd.editor.model.predicate-placeholder')}"
501
532
  @update="${this._updatePredicate}"></jinn-codemirror>
502
533
  </div>
503
-
504
- ${this._isModel()
505
- ? html`
506
- <div>
507
- <div class="behaviourWrapper">
508
- <paper-dropdown-menu label="behaviour" id="behaviourMenu" ?disabled="${this.hasCustomBehaviour}">
509
- <paper-listbox id="behaviour" slot="dropdown-content" attr-for-selected="value"
510
- selected="${this.behaviour}" @iron-select="${this._selectBehaviour}">
511
- ${this.behaviours.map((item) =>
512
- html`
513
- <paper-item value="${item}">${item}</paper-item>
514
- `)}
515
- </paper-listbox>
516
- </paper-dropdown-menu>
517
- <span style="align-self:center;justify-self: center;"> ${translate('odd.editor.model.link-with-or')} </span>
518
- <paper-input id="custombehaviour" label="" @input="${this._handleCustomBehaviour}" placeHolder="${translate('odd.editor.model.custom-behaviour-placeholder')}"></paper-input>
519
- <span></span>
520
- </div>
521
534
 
522
-
523
-
524
- <paper-input id="css" .value="${this.css}"
525
- placeholder="${translate('odd.editor.model.css-class-placeholder')}"
526
- label="CSS Class"
527
- @change="${this._inputCss}"></paper-input>
528
-
529
- <div class="editor">
530
- <label>Template</label>
531
- <jinn-codemirror id="template"
532
- code="${this.template}"
533
- mode="${tmplSyntax}"
534
- placeholder="${translate('odd.editor.model.template-placeholder')}"
535
- @update="${this._updateTemplate}">
536
- <div slot="toolbar">
537
- <paper-button data-mode="xml" data-command="selectElement" data-key="mod-e mod-s"
538
- title="Select element around current cursor position">&lt;|></paper-button>
539
- <paper-button data-mode="xml" data-command="encloseWith" data-key="mod-e mod-e"
540
- title="Enclose selection in new element">&lt;...&gt;</paper-button>
541
- <paper-button data-mode="xml" data-command="removeEnclosing" title="Remove enclosing tags"
542
- data-key="mod-e mod-r" class="sep">&lt;X></paper-button>
543
- <paper-button data-mode="html" data-command="selectElement" data-key="mod-e mod-s"
544
- title="Select element around current cursor position">&lt;|></paper-button>
545
- <paper-button data-mode="html" data-command="encloseWith" data-key="mod-e mod-e"
546
- title="Enclose selection in new element">&lt;...&gt;</paper-button>
547
- <paper-button data-mode="html" data-command="removeEnclosing" title="Remove enclosing tags"
548
- data-key="mod-e mod-r" class="sep">&lt;X></paper-button>
549
- <paper-button data-key="mod-e mod-p" data-command="snippet" data-params="[[\${_}]]" title="Insert template variable">[[...]]</paper-button>
550
- </div>
551
- </jinn-codemirror>
552
- </div>
535
+ ${
536
+ this._isModel()
537
+ ? html`
538
+ <div>
539
+ <div class="behaviourWrapper">
540
+ <paper-dropdown-menu
541
+ label="behaviour"
542
+ id="behaviourMenu"
543
+ ?disabled="${this.hasCustomBehaviour}"
544
+ >
545
+ <paper-listbox
546
+ id="behaviour"
547
+ slot="dropdown-content"
548
+ attr-for-selected="value"
549
+ selected="${this.behaviour}"
550
+ @iron-select="${this._selectBehaviour}"
551
+ >
552
+ ${this.behaviours.map(
553
+ item => html` <paper-item value="${item}">${item}</paper-item> `,
554
+ )}
555
+ </paper-listbox>
556
+ </paper-dropdown-menu>
557
+ <span style="align-self:center;justify-self: center;">
558
+ ${translate('odd.editor.model.link-with-or')}
559
+ </span>
560
+ <paper-input
561
+ id="custombehaviour"
562
+ label=""
563
+ @input="${this._handleCustomBehaviour}"
564
+ placeHolder="${translate(
565
+ 'odd.editor.model.custom-behaviour-placeholder',
566
+ )}"
567
+ ></paper-input>
568
+ <span></span>
569
+ </div>
570
+
571
+ <paper-input
572
+ id="css"
573
+ .value="${this.css}"
574
+ placeholder="${translate('odd.editor.model.css-class-placeholder')}"
575
+ label="CSS Class"
576
+ @change="${this._inputCss}"
577
+ ></paper-input>
578
+
579
+ <div class="editor">
580
+ <label>Template</label>
581
+ <jinn-codemirror
582
+ id="template"
583
+ code="${this.template}"
584
+ mode="${tmplSyntax}"
585
+ placeholder="${translate('odd.editor.model.template-placeholder')}"
586
+ @update="${this._updateTemplate}"
587
+ >
588
+ <div slot="toolbar">
589
+ <paper-button
590
+ data-mode="xml"
591
+ data-command="selectElement"
592
+ data-key="mod-e mod-s"
593
+ title="Select element around current cursor position"
594
+ >&lt;|></paper-button
595
+ >
596
+ <paper-button
597
+ data-mode="xml"
598
+ data-command="encloseWith"
599
+ data-key="mod-e mod-e"
600
+ title="Enclose selection in new element"
601
+ >&lt;...&gt;</paper-button
602
+ >
603
+ <paper-button
604
+ data-mode="xml"
605
+ data-command="removeEnclosing"
606
+ title="Remove enclosing tags"
607
+ data-key="mod-e mod-r"
608
+ class="sep"
609
+ >&lt;X></paper-button
610
+ >
611
+ <paper-button
612
+ data-mode="html"
613
+ data-command="selectElement"
614
+ data-key="mod-e mod-s"
615
+ title="Select element around current cursor position"
616
+ >&lt;|></paper-button
617
+ >
618
+ <paper-button
619
+ data-mode="html"
620
+ data-command="encloseWith"
621
+ data-key="mod-e mod-e"
622
+ title="Enclose selection in new element"
623
+ >&lt;...&gt;</paper-button
624
+ >
625
+ <paper-button
626
+ data-mode="html"
627
+ data-command="removeEnclosing"
628
+ title="Remove enclosing tags"
629
+ data-key="mod-e mod-r"
630
+ class="sep"
631
+ >&lt;X></paper-button
632
+ >
633
+ <paper-button
634
+ data-key="mod-e mod-p"
635
+ data-command="snippet"
636
+ data-params="[[\${_}]]"
637
+ title="Insert template variable"
638
+ >[[...]]</paper-button
639
+ >
640
+ </div>
641
+ </jinn-codemirror>
642
+ </div>
553
643
  </div>
554
-
644
+
555
645
  <div class="parameters">
556
- <div class="group">
557
- <span class="title">Parameters</span>
558
- <paper-icon-button icon="add"
559
- @click="${this._addParameter}"></paper-icon-button>
560
- </div>
561
- ${repeat(this.parameters, (parameter) => parameter.name, (parameter, index) =>
562
- html`
563
- <pb-odd-parameter-editor
564
- behaviour="${this.behaviour}"
565
- name="${parameter.name}"
566
- value="${parameter.value}"
567
- ?set="${parameter.set}"
568
- endpoint="${this.endpoint}"
569
- apiVersion="${this.apiVersion}"
570
- @parameter-remove="${(e) => this._removeParam(e, index)}"
571
- @parameter-changed="${(e) => this._updateParam(e, index)}"
572
- ></pb-odd-parameter-editor>
573
- `)}
646
+ <div class="group">
647
+ <span class="title">Parameters</span>
648
+ <paper-icon-button
649
+ icon="add"
650
+ @click="${this._addParameter}"
651
+ ></paper-icon-button>
652
+ </div>
653
+ ${repeat(
654
+ this.parameters,
655
+ parameter => parameter.name,
656
+ (parameter, index) =>
657
+ html`
658
+ <pb-odd-parameter-editor
659
+ behaviour="${this.behaviour}"
660
+ name="${parameter.name}"
661
+ value="${parameter.value}"
662
+ ?set="${parameter.set}"
663
+ endpoint="${this.endpoint}"
664
+ apiVersion="${this.apiVersion}"
665
+ @parameter-remove="${e => this._removeParam(e, index)}"
666
+ @parameter-changed="${e => this._updateParam(e, index)}"
667
+ ></pb-odd-parameter-editor>
668
+ `,
669
+ )}
574
670
  </div>
575
671
 
576
672
  <div class="renditions">
577
- <div class="group">
578
- <div>
579
- <span class="title">Renditions</span>
580
- <paper-icon-button icon="add" @click="${this._addRendition}"></paper-icon-button>
581
- </div>
582
- <div class="source">
583
- <paper-checkbox ?checked="${this.sourcerend}" id="sourcerend">Use source rendition</paper-checkbox>
584
- </div>
673
+ <div class="group">
674
+ <div>
675
+ <span class="title">Renditions</span>
676
+ <paper-icon-button
677
+ icon="add"
678
+ @click="${this._addRendition}"
679
+ ></paper-icon-button>
585
680
  </div>
586
-
587
- ${repeat(this.renditions, (rendition) => rendition.name, (rendition, index) =>
588
- html`
589
- <pb-odd-rendition-editor scope="${rendition.scope}"
590
- css="${rendition.css}"
591
- @remove-rendition="${(e) => this._removeRendition(e, index)}"
592
- @rendition-changed="${(e) => this._updateRendition(e, index)}"
593
- ></pb-odd-rendition-editor>
594
- `)}
595
-
681
+ <div class="source">
682
+ <paper-checkbox ?checked="${this.sourcerend}" id="sourcerend"
683
+ >Use source rendition</paper-checkbox
684
+ >
685
+ </div>
686
+ </div>
687
+
688
+ ${repeat(
689
+ this.renditions,
690
+ rendition => rendition.name,
691
+ (rendition, index) =>
692
+ html`
693
+ <pb-odd-rendition-editor
694
+ scope="${rendition.scope}"
695
+ css="${rendition.css}"
696
+ @remove-rendition="${e => this._removeRendition(e, index)}"
697
+ @rendition-changed="${e => this._updateRendition(e, index)}"
698
+ ></pb-odd-rendition-editor>
699
+ `,
700
+ )}
596
701
  </div>
597
- `
598
- : ''
599
- }
600
- </iron-collapse>
601
-
702
+ `
703
+ : ''
704
+ }
705
+ </details>
706
+
602
707
  <div class="models">
603
- ${repeat(this.model.models, (model, index) => html`
604
- <pb-odd-model-editor
605
- behaviour="${model.behaviour || 'inline'}"
606
- predicate="${model.predicate}"
607
- type="${model.type}"
608
- output="${model.output}"
609
- css="${model.css}"
610
- mode="${model.mode}"
611
- .model="${model}"
612
- .parameters="${model.parameters}"
613
- desc="${model.desc}"
614
- sourcerend="${model.sourcerend}"
615
- .renditions="${model.renditions}"
616
- .template="${model.template}"
617
- .show="${model.show}"
618
- endpoint="${this.endpoint}"
619
- apiVersion="${this.apiVersion}"
620
- @model-remove="${this._removeModel}"
621
- @model-move-down="${this._moveModelDown}"
622
- @model-move-up="${this._moveModelUp}"
623
- @model-changed="${this.handleModelChanged}"
624
- @click="${ (e) => this.setCurrentSelection(e, index)}"
625
- hasParent
708
+ ${repeat(
709
+ this.model.models,
710
+ (model, index) => html`
711
+ <pb-odd-model-editor
712
+ behaviour="${model.behaviour || 'inline'}"
713
+ predicate="${model.predicate}"
714
+ type="${model.type}"
715
+ output="${model.output}"
716
+ css="${model.css}"
717
+ mode="${model.mode}"
718
+ .model="${model}"
719
+ .parameters="${model.parameters}"
720
+ desc="${model.desc}"
721
+ sourcerend="${model.sourcerend}"
722
+ .renditions="${model.renditions}"
723
+ .template="${model.template}"
724
+ .show="${model.show}"
725
+ endpoint="${this.endpoint}"
726
+ apiVersion="${this.apiVersion}"
727
+ @model-remove="${this._removeModel}"
728
+ @model-move-down="${this._moveModelDown}"
729
+ @model-move-up="${this._moveModelUp}"
730
+ @model-changed="${this.handleModelChanged}"
731
+ @click="${e => this.setCurrentSelection(e, index)}"
732
+ hasParent
626
733
  ></pb-odd-model-editor>
627
- `)}
628
-
629
- </div>
630
- </form>
734
+ `,
735
+ )}
736
+
737
+ </div>
738
+ </form>
631
739
  <pb-message id="dialog"></pb-message>
632
740
  `;
633
- }
634
-
635
- firstUpdated() {
636
- super.firstUpdated();
637
-
638
- this.hasCustomBehaviour = this.behaviours.indexOf(this.behaviour) < 0;
639
- if (this.hasCustomBehaviour) {
640
- this.shadowRoot.getElementById('custombehaviour').value = this.behaviour;
641
- }
642
- }
741
+ }
643
742
 
644
- updated(_changedProperties) {
645
- if (_changedProperties.has('show') && this.show) {
646
- this.refreshEditors();
647
- }
648
- }
743
+ firstUpdated() {
744
+ super.firstUpdated();
649
745
 
650
- refreshEditors() {
651
- console.log('refreshEditors');
652
- // this.shadowRoot.getElementById('predicate').refresh();
653
-
654
- if (this._isGroupOrSequence()) { return console.log("asfdfa"); }
655
-
656
- // this.shadowRoot.getElementById('template').refresh();
657
-
658
- const models = this.shadowRoot.querySelectorAll('pb-odd-model-editor');
659
- for (let i = 0; i < models.length; i++) {
660
- models[i].refreshEditors();
661
- }
662
- const renditions = this.shadowRoot.querySelectorAll('pb-odd-rendition-editor');
663
- for (let i = 0; i < renditions.length; i++) {
664
- renditions[i].refreshEditor();
665
- }
666
- const parameters = this.shadowRoot.querySelectorAll('pb-odd-parameter-editor');
667
- for (let i = 0; i < parameters.length; i++) {
668
- parameters[i].refreshEditor();
669
- }
746
+ this.hasCustomBehaviour = this.behaviours.indexOf(this.behaviour) < 0;
747
+ if (this.hasCustomBehaviour) {
748
+ this.shadowRoot.getElementById('custombehaviour').value = this.behaviour;
670
749
  }
750
+ }
671
751
 
672
- toggle(e) {
673
- // e.stopPropagation()
674
- // e.preventDefault()
675
-
676
- this.show = !this.show;
677
- this.toggleButtonIcon();
678
-
679
- const oldModel = this.model;
680
- const newModel = Object.assign({}, oldModel, { show: this.show });
681
- this.model = newModel;
682
- this.refreshEditors();
683
- this.dispatchEvent(new CustomEvent('model-changed', { composed: true, bubbles: true, detail: { oldModel, newModel } }));
752
+ updated(_changedProperties) {
753
+ if (_changedProperties.has('show') && this.show) {
754
+ this.refreshEditors();
684
755
  }
756
+ }
685
757
 
686
- toggleButtonIcon() {
687
- if (this.show) {
688
- this.icon = 'expand-less';
689
- }
690
- else {
691
- this.icon = 'expand-more';
692
- }
693
- }
758
+ refreshEditors() {
759
+ console.log('refreshEditors');
760
+ // this.shadowRoot.getElementById('predicate').refresh();
694
761
 
695
- _isModel() {
696
- return this.type === 'model';
762
+ if (this._isGroupOrSequence()) {
763
+ return console.log('asfdfa');
697
764
  }
698
765
 
699
- _isGroupOrSequence() {
700
- return this.type !== 'model';
701
- }
766
+ // this.shadowRoot.getElementById('template').refresh();
702
767
 
703
- static _templateMode(output) {
704
- switch (output) {
705
- case 'latex':
706
- return 'latex';
707
- case 'web':
708
- default:
709
- return 'xml';
710
- }
768
+ const models = this.shadowRoot.querySelectorAll('pb-odd-model-editor');
769
+ for (let i = 0; i < models.length; i++) {
770
+ models[i].refreshEditors();
711
771
  }
712
-
713
- _changeSelection(e) {
714
- if (e.detail.target == this) return;
715
- e.preventDefault();
716
- e.stopPropagation();
717
- if (this.currentSelection != undefined) {
718
- this.currentSelection.removeAttribute('currentselection');
719
- }
720
- const newSelection = e.detail.target;
721
- newSelection.setAttribute('currentselection', 'true');
722
- this.currentSelection = newSelection;
772
+ const renditions = this.shadowRoot.querySelectorAll('pb-odd-rendition-editor');
773
+ for (let i = 0; i < renditions.length; i++) {
774
+ renditions[i].refreshEditor();
723
775
  }
724
-
725
- _requestRemoval(e) {
726
- e.preventDefault();
727
- this.dispatchEvent(new CustomEvent('model-remove'));
776
+ const parameters = this.shadowRoot.querySelectorAll('pb-odd-parameter-editor');
777
+ for (let i = 0; i < parameters.length; i++) {
778
+ parameters[i].refreshEditor();
728
779
  }
729
-
730
- /**
731
- * move model down in list
732
- *
733
- * @param e
734
- * @event model-move-down dispatched to request the model to move down
735
- */
736
- _moveDown(e) {
737
- e.preventDefault();
738
- e.stopPropagation();
739
- // this.dispatchEvent(new CustomEvent('model-move-down'));
740
- this.dispatchEvent(new CustomEvent('model-move-down', { composed: true, bubbles: true, detail: { model: this } }));
780
+ }
781
+
782
+ toggle(e) {
783
+ // e.stopPropagation()
784
+ // e.preventDefault()
785
+
786
+ this.show = !this.show;
787
+ this.toggleButtonIcon();
788
+
789
+ const oldModel = this.model;
790
+ const newModel = { ...oldModel, show: this.show };
791
+ this.model = newModel;
792
+ this.refreshEditors();
793
+ this.dispatchEvent(
794
+ new CustomEvent('model-changed', {
795
+ composed: true,
796
+ bubbles: true,
797
+ detail: { oldModel, newModel },
798
+ }),
799
+ );
800
+ }
801
+
802
+ toggleButtonIcon() {
803
+ if (this.show) {
804
+ this.icon = 'expand-less';
805
+ } else {
806
+ this.icon = 'expand-more';
741
807
  }
742
-
743
- /**
744
- * move model up in list
745
- *
746
- * @param e
747
- * @event model-move-up dispatched to request the model to move up
748
- */
749
- _moveUp(e) {
750
- e.preventDefault();
751
- e.stopPropagation();
752
- this.dispatchEvent(new CustomEvent('model-move-up'));
808
+ }
809
+
810
+ _isModel() {
811
+ return this.type === 'model';
812
+ }
813
+
814
+ _isGroupOrSequence() {
815
+ return this.type !== 'model';
816
+ }
817
+
818
+ static _templateMode(output) {
819
+ switch (output) {
820
+ case 'latex':
821
+ return 'latex';
822
+ case 'web':
823
+ default:
824
+ return 'xml';
753
825
  }
754
-
755
- _addNested(e) {
756
- const newNestedModel = {
757
- behaviour: 'inline',
758
- css: '',
759
- desc: '',
760
- predicate: '',
761
- type: e instanceof Event ? e.detail.item.getAttribute('value') : e,
762
- output: '',
763
- sourcerend: false,
764
- models: [],
765
- mode: '',
766
- parameters: [],
767
- renditions: [],
768
- template: '',
769
- show: true
770
- };
771
-
772
- const oldModel = this.model;
773
- const models = Array.from(this.model.models);
774
- models.unshift(newNestedModel);
775
- this.model = Object.assign({}, oldModel, { models });
776
-
777
- // important to reset the listbox - otherwise next attempt to use it will fail if value has not changed
778
- // use querySelector here instead of 'this.$' as listbox is in it's own <template>
779
- const modelTypeSelector = this.shadowRoot.querySelector('#modelType')
780
- modelTypeSelector.select("");
781
-
782
- this.dispatchEvent(new CustomEvent('model-changed', { composed: true, bubbles: true, detail: { oldModel, newModel: this.model } }));
826
+ }
827
+
828
+ _changeSelection(e) {
829
+ if (e.detail.target == this) return;
830
+ e.preventDefault();
831
+ e.stopPropagation();
832
+ if (this.currentSelection != undefined) {
833
+ this.currentSelection.removeAttribute('currentselection');
783
834
  }
784
-
785
- addModel(newModel) {
786
- if (newModel.type !== 'model') {
787
- console.error('only models can be added to modelSequence or modelGrp');
788
- return;
789
- }
790
- this.model.models.unshift(newModel);
791
- this.requestUpdate();
835
+ const newSelection = e.detail.target;
836
+ newSelection.setAttribute('currentselection', 'true');
837
+ this.currentSelection = newSelection;
838
+ }
839
+
840
+ _requestRemoval(e) {
841
+ e.preventDefault();
842
+ this.dispatchEvent(new CustomEvent('model-remove'));
843
+ }
844
+
845
+ /**
846
+ * move model down in list
847
+ *
848
+ * @param e
849
+ * @event model-move-down dispatched to request the model to move down
850
+ */
851
+ _moveDown(e) {
852
+ e.preventDefault();
853
+ e.stopPropagation();
854
+ // this.dispatchEvent(new CustomEvent('model-move-down'));
855
+ this.dispatchEvent(
856
+ new CustomEvent('model-move-down', {
857
+ composed: true,
858
+ bubbles: true,
859
+ detail: { model: this },
860
+ }),
861
+ );
862
+ }
863
+
864
+ /**
865
+ * move model up in list
866
+ *
867
+ * @param e
868
+ * @event model-move-up dispatched to request the model to move up
869
+ */
870
+ _moveUp(e) {
871
+ e.preventDefault();
872
+ e.stopPropagation();
873
+ this.dispatchEvent(new CustomEvent('model-move-up'));
874
+ }
875
+
876
+ _addNested(e) {
877
+ const newNestedModel = {
878
+ behaviour: 'inline',
879
+ css: '',
880
+ desc: '',
881
+ predicate: '',
882
+ type: e instanceof Event ? e.detail.item.getAttribute('value') : e,
883
+ output: '',
884
+ sourcerend: false,
885
+ models: [],
886
+ mode: '',
887
+ parameters: [],
888
+ renditions: [],
889
+ template: '',
890
+ show: true,
891
+ };
892
+
893
+ const oldModel = this.model;
894
+ const models = Array.from(this.model.models);
895
+ models.unshift(newNestedModel);
896
+ this.model = { ...oldModel, models };
897
+
898
+ // important to reset the listbox - otherwise next attempt to use it will fail if value has not changed
899
+ // use querySelector here instead of 'this.$' as listbox is in it's own <template>
900
+ const modelTypeSelector = this.shadowRoot.querySelector('#modelType');
901
+ modelTypeSelector.select('');
902
+
903
+ this.dispatchEvent(
904
+ new CustomEvent('model-changed', {
905
+ composed: true,
906
+ bubbles: true,
907
+ detail: { oldModel, newModel: this.model },
908
+ }),
909
+ );
910
+ }
911
+
912
+ addModel(newModel) {
913
+ if (newModel.type !== 'model') {
914
+ console.error('only models can be added to modelSequence or modelGrp');
915
+ return;
792
916
  }
793
-
794
- _removeModel(ev) {
795
- console.log('_removeModel ', ev);
796
- ev.stopPropagation();
797
- const { model } = ev.target;
798
- const index = this.model.models.indexOf(model)
799
-
800
- this.shadowRoot.getElementById('dialog')
801
- .confirm(i18n('odd.editor.model.delete-model-label'), i18n('odd.editor.model.delete-model-message'))
802
- .then(() => {
803
- const oldModel = this.model;
804
- const models = Array.from(this.model.models);
805
- models.splice(index, 1);
806
- this.model = Object.assign({}, oldModel, { models });
807
- this.models = models;
808
- this.dispatchEvent(new CustomEvent('model-changed', { composed: true, bubbles: true, detail: { oldModel, newModel: this.model } }));
809
- }, () => null);
917
+ this.model.models.unshift(newModel);
918
+ this.requestUpdate();
919
+ }
920
+
921
+ _removeModel(ev) {
922
+ console.log('_removeModel ', ev);
923
+ ev.stopPropagation();
924
+ const { model } = ev.target;
925
+ const index = this.model.models.indexOf(model);
926
+
927
+ this.shadowRoot
928
+ .getElementById('dialog')
929
+ .confirm(
930
+ i18n('odd.editor.model.delete-model-label'),
931
+ i18n('odd.editor.model.delete-model-message'),
932
+ )
933
+ .then(
934
+ () => {
935
+ const oldModel = this.model;
936
+ const models = Array.from(this.model.models);
937
+ models.splice(index, 1);
938
+ this.model = { ...oldModel, models };
939
+ this.models = models;
940
+ this.dispatchEvent(
941
+ new CustomEvent('model-changed', {
942
+ composed: true,
943
+ bubbles: true,
944
+ detail: { oldModel, newModel: this.model },
945
+ }),
946
+ );
947
+ },
948
+ () => null,
949
+ );
950
+ }
951
+
952
+ _moveModelDown(ev) {
953
+ console.log('MODEL._moveModelDown ', ev);
954
+ ev.stopPropagation();
955
+ const { model } = ev.target;
956
+ const index = this.model.models.indexOf(model);
957
+ if (index === this.model.models.length) {
958
+ return;
810
959
  }
811
-
812
- _moveModelDown(ev) {
813
- console.log('MODEL._moveModelDown ', ev);
814
- ev.stopPropagation();
815
- const { model } = ev.target;
816
- const index = this.model.models.indexOf(model)
817
- if (index === this.model.models.length) {
818
- return;
819
- }
820
- const oldModel = this.model;
821
- const models = Array.from(this.model.models);
822
- models.splice(index, 1);
823
- models.splice(index + 1, 0, model);
824
- this.model = Object.assign({}, oldModel, { models });
825
-
826
- const targetModel = this.shadowRoot.querySelectorAll('pb-odd-model-editor')[index + 1];
827
- this._setCurrentSelection(index + 1, targetModel);
828
-
829
- this.dispatchEvent(new CustomEvent('model-changed', { composed: true, bubbles: true, detail: { oldModel, newModel: this.model } }));
830
- this.requestUpdate();
960
+ const oldModel = this.model;
961
+ const models = Array.from(this.model.models);
962
+ models.splice(index, 1);
963
+ models.splice(index + 1, 0, model);
964
+ this.model = { ...oldModel, models };
965
+
966
+ const targetModel = this.shadowRoot.querySelectorAll('pb-odd-model-editor')[index + 1];
967
+ this._setCurrentSelection(index + 1, targetModel);
968
+
969
+ this.dispatchEvent(
970
+ new CustomEvent('model-changed', {
971
+ composed: true,
972
+ bubbles: true,
973
+ detail: { oldModel, newModel: this.model },
974
+ }),
975
+ );
976
+ this.requestUpdate();
977
+ }
978
+
979
+ _moveModelUp(ev) {
980
+ ev.stopPropagation();
981
+ const { model } = ev.target;
982
+ const index = this.model.models.indexOf(model);
983
+ if (index === 0) {
984
+ return;
831
985
  }
832
-
833
- _moveModelUp(ev) {
834
- ev.stopPropagation();
835
- const { model } = ev.target;
836
- const index = this.model.models.indexOf(model)
837
- if (index === 0) {
838
- return;
839
- }
840
- const oldModel = this.model;
841
- const models = Array.from(this.model.models);
842
- // remove element from models
843
- models.splice(index, 1);
844
- // add element to new index
845
- models.splice(index - 1, 0, model);
846
- this.model = Object.assign({}, oldModel, { models });
847
-
848
- const targetModel = this.shadowRoot.querySelectorAll('pb-odd-model-editor')[index - 1];
849
- this._setCurrentSelection(index - 1, targetModel);
850
-
851
- this.dispatchEvent(new CustomEvent('model-changed', { composed: true, bubbles: true, detail: { oldModel, newModel: this.model } }));
852
- // this.requestUpdate();
986
+ const oldModel = this.model;
987
+ const models = Array.from(this.model.models);
988
+ // remove element from models
989
+ models.splice(index, 1);
990
+ // add element to new index
991
+ models.splice(index - 1, 0, model);
992
+ this.model = { ...oldModel, models };
993
+
994
+ const targetModel = this.shadowRoot.querySelectorAll('pb-odd-model-editor')[index - 1];
995
+ this._setCurrentSelection(index - 1, targetModel);
996
+
997
+ this.dispatchEvent(
998
+ new CustomEvent('model-changed', {
999
+ composed: true,
1000
+ bubbles: true,
1001
+ detail: { oldModel, newModel: this.model },
1002
+ }),
1003
+ );
1004
+ // this.requestUpdate();
1005
+ }
1006
+
1007
+ handleModelChanged(ev) {
1008
+ console.log('handleModelChanged ', ev, this);
1009
+ ev.stopPropagation();
1010
+ const oldModel = this.model;
1011
+ const index = this.model.models.indexOf(ev.detail.oldModel);
1012
+ const models = Array.from(this.model.models);
1013
+ models.splice(index, 1, ev.detail.newModel);
1014
+ this.model = { ...oldModel, models };
1015
+ this.dispatchEvent(
1016
+ new CustomEvent('model-changed', {
1017
+ composed: true,
1018
+ bubbles: true,
1019
+ detail: { oldModel, newModel: this.model },
1020
+ }),
1021
+ );
1022
+ }
1023
+
1024
+ // todo: setCurrentSelection functions are redundant in model and elementspec components - do better
1025
+ setCurrentSelection(e, index) {
1026
+ e.preventDefault();
1027
+ e.stopPropagation();
1028
+
1029
+ // prevent event if model is already the current one
1030
+ this._setCurrentSelection(index, e.target);
1031
+ }
1032
+
1033
+ _setCurrentSelection(index, target) {
1034
+ // console.log('_setCurrentSelection ', target);
1035
+ const targetModel = this.shadowRoot.querySelectorAll('pb-odd-model-editor')[index];
1036
+
1037
+ if (!targetModel) {
1038
+ return;
853
1039
  }
854
1040
 
855
- handleModelChanged(ev) {
856
- console.log('handleModelChanged ', ev, this);
857
- ev.stopPropagation();
858
- const oldModel = this.model;
859
- const index = this.model.models.indexOf(ev.detail.oldModel);
860
- const models = Array.from(this.model.models);
861
- models.splice(index, 1, ev.detail.newModel);
862
- this.model = Object.assign({}, oldModel, { models });
863
- this.dispatchEvent(new CustomEvent('model-changed', { composed: true, bubbles: true, detail: { oldModel, newModel: this.model } }));
1041
+ if (targetModel.hasAttribute('currentselection')) return;
1042
+
1043
+ this.dispatchEvent(
1044
+ new CustomEvent('current-changed', { composed: true, bubbles: true, detail: { target } }),
1045
+ );
1046
+ this.requestUpdate();
1047
+ }
1048
+
1049
+ _inputDesc(e) {
1050
+ this.desc = e.composedPath()[0].value;
1051
+ this._fireModelChanged('desc', this.desc);
1052
+ }
1053
+
1054
+ _selectOutput(e) {
1055
+ this.output = e.composedPath()[0].selected;
1056
+ this._fireModelChanged('output', this.output);
1057
+ }
1058
+
1059
+ _updatePredicate() {
1060
+ this.predicate = this.shadowRoot.getElementById('predicate').value;
1061
+ console.log('_updatePredicate ', this.predicate);
1062
+ this._fireModelChanged('predicate', this.predicate);
1063
+ }
1064
+
1065
+ _selectBehaviour(ev) {
1066
+ this.behaviour = ev.composedPath()[0].selected;
1067
+ this._fireModelChanged('behaviour', this.behaviour);
1068
+ }
1069
+
1070
+ _inputCss(ev) {
1071
+ this.css = ev.composedPath()[0].value;
1072
+ this._fireModelChanged('css', this.css);
1073
+ }
1074
+
1075
+ _inputMode(ev) {
1076
+ this.mode = ev.composedPath()[0].value;
1077
+ this._fireModelChanged('mode', this.mode);
1078
+ }
1079
+
1080
+ _updateTemplate(ev) {
1081
+ this.template = this.shadowRoot.getElementById('template').content;
1082
+ this._fireModelChanged('template', this.template);
1083
+ }
1084
+
1085
+ /**
1086
+ * add a model parameter
1087
+ *
1088
+ * @param e
1089
+ */
1090
+ _addParameter(e) {
1091
+ this.parameters.push({ name: '', value: '' });
1092
+ this._fireModelChanged('parameters', this.parameters);
1093
+ }
1094
+
1095
+ _updateParam(e, index) {
1096
+ this.parameters[index].name = e.detail.name;
1097
+ this.parameters[index].value = e.detail.value;
1098
+ this.parameters[index].set = e.detail.set;
1099
+ this._fireModelChanged('parameters', this.parameters);
1100
+ }
1101
+
1102
+ /**
1103
+ * remove a parameter
1104
+ * @param e
1105
+ * @param index
1106
+ * @private
1107
+ */
1108
+ _removeParam(e, index) {
1109
+ this.parameters.splice(index, 1);
1110
+ this._fireModelChanged('parameters', this.parameters);
1111
+ }
1112
+
1113
+ /**
1114
+ * add a rendition
1115
+ *
1116
+ * @param ev
1117
+ */
1118
+ _addRendition(ev) {
1119
+ this.renditions.push({
1120
+ scope: '',
1121
+ css: '',
1122
+ });
1123
+ this._fireModelChanged('renditions', this.renditions);
1124
+ }
1125
+
1126
+ _updateRendition(e, index) {
1127
+ this.renditions[index].css = e.detail.css;
1128
+ this.renditions[index].scope = e.detail.scope;
1129
+ this._fireModelChanged('renditions', this.renditions);
1130
+ }
1131
+
1132
+ _removeRendition(e, index) {
1133
+ this.renditions.splice(index, 1);
1134
+ this._fireModelChanged('renditions', this.renditions);
1135
+ }
1136
+
1137
+ _fireModelChanged(prop, value) {
1138
+ const oldModel = this.model;
1139
+ this.model = { ...this.model, [prop]: value };
1140
+ console.log('model changed for %s: %o - %o', prop, value, this.model);
1141
+ this.dispatchEvent(
1142
+ new CustomEvent('model-changed', {
1143
+ composed: true,
1144
+ bubbles: true,
1145
+ detail: { oldModel, newModel: this.model },
1146
+ }),
1147
+ );
1148
+ this.requestUpdate();
1149
+ }
1150
+
1151
+ _copy(ev) {
1152
+ ev.preventDefault();
1153
+ ev.stopPropagation();
1154
+ console.log('odd-model.copy ', ev);
1155
+ console.log('odd-model.copy data', this.model);
1156
+
1157
+ this.dispatchEvent(
1158
+ new CustomEvent('odd-copy', { composed: true, bubbles: true, detail: { model: this.model } }),
1159
+ );
1160
+ }
1161
+
1162
+ _paste(ev) {
1163
+ console.log('model _paste ', ev);
1164
+ this.dispatchEvent(
1165
+ new CustomEvent('odd-paste', { composed: true, bubbles: true, detail: { target: this } }),
1166
+ );
1167
+ }
1168
+
1169
+ _handleCustomBehaviour(e) {
1170
+ this.behaviour = e.composedPath()[0].value;
1171
+ this._fireModelChanged('behaviour', this.behaviour);
1172
+
1173
+ // en-/disable behaviour menu
1174
+ if (this.behaviour === '') {
1175
+ this.behaviour = 'inline';
1176
+ this.hasCustomBehaviour = false;
1177
+ } else {
1178
+ this.hasCustomBehaviour = true;
864
1179
  }
865
-
866
-
867
- //todo: setCurrentSelection functions are redundant in model and elementspec components - do better
868
- setCurrentSelection(e, index) {
869
- e.preventDefault();
870
- e.stopPropagation();
871
-
872
- //prevent event if model is already the current one
873
- this._setCurrentSelection(index, e.target);
874
- }
875
-
876
- _setCurrentSelection(index, target) {
877
- // console.log('_setCurrentSelection ', target);
878
- const targetModel = this.shadowRoot.querySelectorAll('pb-odd-model-editor')[index];
879
-
880
- if (!targetModel) { return; }
881
-
882
- if (targetModel.hasAttribute('currentselection')) return;
883
-
884
- this.dispatchEvent(new CustomEvent('current-changed', { composed: true, bubbles: true, detail: { target: target } }));
885
- this.requestUpdate();
886
- }
887
-
888
- _inputDesc(e) {
889
- this.desc = e.composedPath()[0].value;
890
- this._fireModelChanged('desc', this.desc);
891
- }
892
-
893
- _selectOutput(e) {
894
- this.output = e.composedPath()[0].selected;
895
- this._fireModelChanged('output', this.output);
896
- }
897
-
898
- _updatePredicate() {
899
- this.predicate = this.shadowRoot.getElementById('predicate').value;
900
- console.log('_updatePredicate ', this.predicate);
901
- this._fireModelChanged('predicate', this.predicate);
902
- }
903
-
904
- _selectBehaviour(ev) {
905
- this.behaviour = ev.composedPath()[0].selected;
906
- this._fireModelChanged('behaviour', this.behaviour);
907
- }
908
-
909
- _inputCss(ev) {
910
- this.css = ev.composedPath()[0].value;
911
- this._fireModelChanged('css', this.css);
912
- }
913
-
914
- _inputMode(ev) {
915
- this.mode = ev.composedPath()[0].value;
916
- this._fireModelChanged('mode', this.mode);
917
- }
918
-
919
- _updateTemplate(ev) {
920
- this.template = this.shadowRoot.getElementById('template').content;
921
- this._fireModelChanged('template', this.template);
922
- }
923
-
924
- /**
925
- * add a model parameter
926
- *
927
- * @param e
928
- */
929
- _addParameter(e) {
930
- this.parameters.push({ name: "", value: "" });
931
- this._fireModelChanged('parameters', this.parameters);
932
- }
933
-
934
- _updateParam(e, index) {
935
- this.parameters[index].name = e.detail.name;
936
- this.parameters[index].value = e.detail.value;
937
- this.parameters[index].set = e.detail.set;
938
- this._fireModelChanged('parameters', this.parameters);
939
- }
940
-
941
- /**
942
- * remove a parameter
943
- * @param e
944
- * @param index
945
- * @private
946
- */
947
- _removeParam(e, index) {
948
- this.parameters.splice(index, 1);
949
- this._fireModelChanged('parameters', this.parameters);
950
- }
951
-
952
- /**
953
- * add a rendition
954
- *
955
- * @param ev
956
- */
957
- _addRendition(ev) {
958
- this.renditions.push({
959
- scope: '',
960
- css: ''
961
- });
962
- this._fireModelChanged('renditions', this.renditions);
963
- }
964
-
965
- _updateRendition(e, index) {
966
- this.renditions[index].css = e.detail.css;
967
- this.renditions[index].scope = e.detail.scope;
968
- this._fireModelChanged('renditions', this.renditions);
969
- }
970
-
971
- _removeRendition(e, index) {
972
- this.renditions.splice(index, 1);
973
- this._fireModelChanged('renditions', this.renditions);
974
- }
975
-
976
- _fireModelChanged(prop, value) {
977
- const oldModel = this.model;
978
- this.model = Object.assign({}, this.model, { [prop]: value });
979
- console.log('model changed for %s: %o - %o', prop, value, this.model);
980
- this.dispatchEvent(new CustomEvent('model-changed', { composed: true, bubbles: true, detail: { oldModel, newModel: this.model } }));
981
- this.requestUpdate();
982
- }
983
-
984
- _copy(ev) {
985
- ev.preventDefault();
986
- ev.stopPropagation();
987
- console.log('odd-model.copy ', ev);
988
- console.log('odd-model.copy data', this.model);
989
-
990
- this.dispatchEvent(new CustomEvent('odd-copy', { composed: true, bubbles: true, detail: { model: this.model } }));
991
- }
992
-
993
- _paste(ev) {
994
- console.log('model _paste ', ev);
995
- this.dispatchEvent(new CustomEvent('odd-paste', { composed: true, bubbles: true, detail: { target: this } }));
996
- }
997
-
998
-
999
- _handleCustomBehaviour(e) {
1000
- this.behaviour = e.composedPath()[0].value;
1001
- this._fireModelChanged('behaviour', this.behaviour);
1002
-
1003
- // en-/disable behaviour menu
1004
- if (this.behaviour === '') {
1005
- this.behaviour = 'inline';
1006
- this.hasCustomBehaviour = false;
1007
- } else {
1008
- this.hasCustomBehaviour = true;
1009
- }
1010
- this.requestUpdate();
1011
-
1012
- }
1013
-
1014
-
1015
-
1180
+ this.requestUpdate();
1181
+ }
1016
1182
  }
1017
1183
  customElements.define('pb-odd-model-editor', PbOddModelEditor);