@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
@@ -1,204 +1,209 @@
1
- import { LitElement, html, css } from 'lit-element';
2
- import "prismjs/prism";
3
- import 'prismjs/components/prism-xquery';
4
- import 'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace';
5
- import 'prismjs/plugins/line-numbers/prism-line-numbers';
6
- import { resolveURL, getCSSProperty } from './utils.js';
7
- import { themableMixin } from "./theming.js";
8
-
9
- const PRISM_THEMES = new Map();
10
-
11
- function loadTheme(theme) {
12
- const themeName = theme === 'default' ? 'prism.css' : `prism-${theme}.css`;
13
- if (PRISM_THEMES.has(themeName)) {
14
- console.log('Using cached theme: %s', themeName);
15
- return PRISM_THEMES.get(themeName);
16
- }
17
-
18
- const promise = new Promise((resolve) => {
19
- const resource = resolveURL('../css/prismjs/') + themeName;
20
- console.log('<pb-code-highlight> loading theme %s from %s', theme, resource);
21
- fetch(resource)
22
- .then(response => response.text())
23
- .catch(() => resolve(''))
24
- .then(text => {
25
- resolve(html`<style>${text}</style>`);
26
- });
27
- });
28
- PRISM_THEMES.set(themeName, promise);
29
- return promise;
30
- }
31
-
32
- /**
33
- * Highlight a code snippet. The snippet may either be passed in a template child
34
- * element, which could contain HTML or text. If no template child is present, the
35
- * component will take any text content contained in it and highlight it. One can also
36
- * pass the code to be highlighted in the `code` property.
37
- *
38
- * @cssprop [--pb-code-highlight-white-space=pre] - configures line wrapping
39
- * @cssprop [--pb-code-highlight-theme=default] - configures the default theme to be used
40
- */
41
- export class PbCodeHighlight extends themableMixin(LitElement) {
42
- static get properties() {
43
- return {
44
- /**
45
- * The language to be used for syntax highlighting.
46
- */
47
- language: {
48
- type: String
49
- },
50
- /**
51
- * The code to be highlighted as a string. If not set,
52
- * this will be populated from either a template child element
53
- * or the element's text content.
54
- * The value of the property can be changed programmatically from JavaScript.
55
- */
56
- code: {
57
- type: String
58
- },
59
- /**
60
- * Highlighting theme to use: 'coy', 'dark', 'funky', 'okaida', 'solarizedlight',
61
- * 'tomorrow', 'twilight' or 'default'.
62
- */
63
- theme: {
64
- type: String
65
- },
66
- lineNumbers: {
67
- type: Boolean,
68
- attribute: 'line-numbers'
69
- },
70
- _themeStyles: {
71
- type: String
72
- }
73
- };
74
- }
75
-
76
- constructor() {
77
- super();
78
- this.language = 'xml';
79
- this.theme = 'default';
80
- this.lineNumbers = false;
81
- this._themeStyles = null;
82
- }
83
-
84
- connectedCallback() {
85
- super.connectedCallback();
86
- let theme = this.getAttribute('theme');
87
- if (theme === null) {
88
- theme = getCSSProperty(this, '--pb-code-highlight-theme', 'default');
89
- this.setAttribute('theme', theme);
90
- }
91
- }
92
-
93
- firstUpdated() {
94
- super.firstUpdated();
95
-
96
- if (!this.code) {
97
- const template = this.querySelector('template');
98
- if (template) {
99
- this.code = Prism.plugins.NormalizeWhitespace.normalize(template.innerHTML);
100
- } else {
101
- this.code = Prism.plugins.NormalizeWhitespace.normalize(this.textContent);
102
- }
103
- }
104
- }
105
-
106
- attributeChangedCallback(name, oldValue, newValue) {
107
- super.attributeChangedCallback(name, oldValue, newValue);
108
- switch (name) {
109
- case 'theme':
110
- loadTheme(newValue).then(loadedStyles => {
111
- this._themeStyles = loadedStyles;
112
- });
113
- break;
114
- default:
115
- break;
116
- }
117
- }
118
-
119
- updated(changedProperties) {
120
- super.updated(changedProperties);
121
- if (changedProperties.has('code')) {
122
- //if the code property is changed, the content of the <code> element is replaced
123
- const pre = this.shadowRoot.getElementById("pb-code-highlight");
124
- if(pre != null) {
125
- const code = document.createElement("code");
126
- code.textContent = this.code; //textContent property keeps new lines in the code
127
- pre.replaceChildren(code);
128
-
129
- }
130
- this.highlight();
131
- }
132
- }
133
-
134
- highlight() {
135
- Prism.highlightAllUnder(this.shadowRoot);
136
- }
137
-
138
- render() {
139
- if (this.code) {
140
- return html`
141
- ${this._themeStyles}
142
- <pre id="pb-code-highlight" class="${this.lineNumbers ? 'line-numbers' : ''} language-${this.language}"><code>${this.code}</code></pre>
143
- `;
144
- }
145
- return html`<pre class="line-numbers"><code><code></pre>`;
146
- }
147
-
148
- static get styles() {
149
- return css`
150
- :host {
151
- display: block;
152
- }
153
- pre[class*='language-'] {
154
- margin: 0;
155
- }
156
- code[class*='language-'] {
157
- white-space: var(--pb-code-highlight-white-space, pre);
158
- }
159
- pre.line-numbers {
160
- position: relative;
161
- padding-left: 3.8em;
162
- counter-reset: linenumber;
163
- }
164
-
165
- pre.line-numbers > code {
166
- position: relative;
167
- white-space: inherit;
168
- }
169
-
170
- .line-numbers .line-numbers-rows {
171
- position: absolute;
172
- pointer-events: none;
173
- top: 0;
174
- font-size: 100%;
175
- left: -3.8em;
176
- width: 3em; /* works for line-numbers below 1000 lines */
177
- letter-spacing: -1px;
178
- border-right: 1px solid #999;
179
-
180
- -webkit-user-select: none;
181
- -moz-user-select: none;
182
- -ms-user-select: none;
183
- user-select: none;
184
-
185
- }
186
-
187
- .line-numbers-rows > span {
188
- pointer-events: none;
189
- display: block;
190
- counter-increment: linenumber;
191
- height: auto !important;
192
- }
193
-
194
- .line-numbers-rows > span:before {
195
- content: counter(linenumber);
196
- color: #999;
197
- display: block;
198
- padding-right: 0.8em;
199
- text-align: right;
200
- }
201
- `;
202
- }
203
- }
204
- customElements.define('pb-code-highlight', PbCodeHighlight);
1
+ import { LitElement, html, css } from 'lit-element';
2
+ import 'prismjs/prism';
3
+ import 'prismjs/components/prism-xquery';
4
+ import 'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace';
5
+ import 'prismjs/plugins/line-numbers/prism-line-numbers';
6
+ import { resolveURL, getCSSProperty } from './utils.js';
7
+ import { themableMixin } from './theming.js';
8
+
9
+ const PRISM_THEMES = new Map();
10
+
11
+ function loadTheme(theme) {
12
+ const themeName = theme === 'default' ? 'prism.css' : `prism-${theme}.css`;
13
+ if (PRISM_THEMES.has(themeName)) {
14
+ console.log('Using cached theme: %s', themeName);
15
+ return PRISM_THEMES.get(themeName);
16
+ }
17
+
18
+ const promise = new Promise(resolve => {
19
+ const resource = resolveURL('../css/prismjs/') + themeName;
20
+ console.log('<pb-code-highlight> loading theme %s from %s', theme, resource);
21
+ fetch(resource)
22
+ .then(response => response.text())
23
+ .catch(() => resolve(''))
24
+ .then(text => {
25
+ resolve(
26
+ html`<style>
27
+ ${text}
28
+ </style>`,
29
+ );
30
+ });
31
+ });
32
+ PRISM_THEMES.set(themeName, promise);
33
+ return promise;
34
+ }
35
+
36
+ /**
37
+ * Highlight a code snippet. The snippet may either be passed in a template child
38
+ * element, which could contain HTML or text. If no template child is present, the
39
+ * component will take any text content contained in it and highlight it. One can also
40
+ * pass the code to be highlighted in the `code` property.
41
+ *
42
+ * @cssprop [--pb-code-highlight-white-space=pre] - configures line wrapping
43
+ * @cssprop [--pb-code-highlight-theme=default] - configures the default theme to be used
44
+ */
45
+ export class PbCodeHighlight extends themableMixin(LitElement) {
46
+ static get properties() {
47
+ return {
48
+ /**
49
+ * The language to be used for syntax highlighting.
50
+ */
51
+ language: {
52
+ type: String,
53
+ },
54
+ /**
55
+ * The code to be highlighted as a string. If not set,
56
+ * this will be populated from either a template child element
57
+ * or the element's text content.
58
+ * The value of the property can be changed programmatically from JavaScript.
59
+ */
60
+ code: {
61
+ type: String,
62
+ },
63
+ /**
64
+ * Highlighting theme to use: 'coy', 'dark', 'funky', 'okaida', 'solarizedlight',
65
+ * 'tomorrow', 'twilight' or 'default'.
66
+ */
67
+ theme: {
68
+ type: String,
69
+ },
70
+ lineNumbers: {
71
+ type: Boolean,
72
+ attribute: 'line-numbers',
73
+ },
74
+ _themeStyles: {
75
+ type: String,
76
+ },
77
+ };
78
+ }
79
+
80
+ constructor() {
81
+ super();
82
+ this.language = 'xml';
83
+ this.theme = 'default';
84
+ this.lineNumbers = false;
85
+ this._themeStyles = null;
86
+ }
87
+
88
+ connectedCallback() {
89
+ super.connectedCallback();
90
+ let theme = this.getAttribute('theme');
91
+ if (theme === null) {
92
+ theme = getCSSProperty(this, '--pb-code-highlight-theme', 'default');
93
+ this.setAttribute('theme', theme);
94
+ }
95
+ }
96
+
97
+ firstUpdated() {
98
+ super.firstUpdated();
99
+
100
+ if (!this.code) {
101
+ const template = this.querySelector('template');
102
+ if (template) {
103
+ this.code = Prism.plugins.NormalizeWhitespace.normalize(template.innerHTML);
104
+ } else {
105
+ this.code = Prism.plugins.NormalizeWhitespace.normalize(this.textContent);
106
+ }
107
+ }
108
+ }
109
+
110
+ attributeChangedCallback(name, oldValue, newValue) {
111
+ super.attributeChangedCallback(name, oldValue, newValue);
112
+ switch (name) {
113
+ case 'theme':
114
+ loadTheme(newValue).then(loadedStyles => {
115
+ this._themeStyles = loadedStyles;
116
+ });
117
+ break;
118
+ default:
119
+ break;
120
+ }
121
+ }
122
+
123
+ updated(changedProperties) {
124
+ super.updated(changedProperties);
125
+ if (changedProperties.has('code')) {
126
+ // if the code property is changed, the content of the <code> element is replaced
127
+ const pre = this.shadowRoot.getElementById('pb-code-highlight');
128
+ if (pre != null) {
129
+ const code = document.createElement('code');
130
+ code.textContent = this.code; // textContent property keeps new lines in the code
131
+ pre.replaceChildren(code);
132
+ }
133
+ this.highlight();
134
+ }
135
+ }
136
+
137
+ highlight() {
138
+ Prism.highlightAllUnder(this.shadowRoot);
139
+ }
140
+
141
+ render() {
142
+ if (this.code) {
143
+ return html`
144
+ ${this._themeStyles}
145
+ <pre
146
+ id="pb-code-highlight"
147
+ class="${this.lineNumbers ? 'line-numbers' : ''} language-${this.language}"
148
+ ><code>${this.code}</code></pre>
149
+ `;
150
+ }
151
+ return html`<pre class="line-numbers"><code><code></pre>`;
152
+ }
153
+
154
+ static get styles() {
155
+ return css`
156
+ :host {
157
+ display: block;
158
+ }
159
+ pre[class*='language-'] {
160
+ margin: 0;
161
+ }
162
+ code[class*='language-'] {
163
+ white-space: var(--pb-code-highlight-white-space, pre);
164
+ }
165
+ pre.line-numbers {
166
+ position: relative;
167
+ padding-left: 3.8em;
168
+ counter-reset: linenumber;
169
+ }
170
+
171
+ pre.line-numbers > code {
172
+ position: relative;
173
+ white-space: inherit;
174
+ }
175
+
176
+ .line-numbers .line-numbers-rows {
177
+ position: absolute;
178
+ pointer-events: none;
179
+ top: 0;
180
+ font-size: 100%;
181
+ left: -3.8em;
182
+ width: 3em; /* works for line-numbers below 1000 lines */
183
+ letter-spacing: -1px;
184
+ border-right: 1px solid #999;
185
+
186
+ -webkit-user-select: none;
187
+ -moz-user-select: none;
188
+ -ms-user-select: none;
189
+ user-select: none;
190
+ }
191
+
192
+ .line-numbers-rows > span {
193
+ pointer-events: none;
194
+ display: block;
195
+ counter-increment: linenumber;
196
+ height: auto !important;
197
+ }
198
+
199
+ .line-numbers-rows > span:before {
200
+ content: counter(linenumber);
201
+ color: #999;
202
+ display: block;
203
+ padding-right: 0.8em;
204
+ text-align: right;
205
+ }
206
+ `;
207
+ }
208
+ }
209
+ customElements.define('pb-code-highlight', PbCodeHighlight);
package/src/pb-codepen.js CHANGED
@@ -1,85 +1,92 @@
1
1
  import { LitElement, html, css } from 'lit-element';
2
2
 
3
-
4
3
  /**
5
4
  * Embed a codepen project to show live code. Used for some documentation examples.
6
5
  *
7
6
  */
8
7
  export class PbCodepen extends LitElement {
8
+ static get properties() {
9
+ return {
10
+ ...super.properties,
11
+ /**
12
+ * The user which created the codepen
13
+ */
14
+ user: {
15
+ type: String,
16
+ },
17
+ /**
18
+ * Identifies the pen
19
+ */
20
+ hash: {
21
+ type: String,
22
+ },
23
+ /**
24
+ * Height of the iframe in pixel
25
+ */
26
+ height: {
27
+ type: Number,
28
+ },
29
+ /**
30
+ * Either 'dark' or 'light'
31
+ */
32
+ theme: {
33
+ type: String,
34
+ },
35
+ /**
36
+ * If set, the codepen will not load before being
37
+ * clicked by the user
38
+ */
39
+ preview: {
40
+ type: Boolean,
41
+ },
42
+ /**
43
+ * Make the codepen editable (requires paid account)
44
+ */
45
+ editable: {
46
+ type: Boolean,
47
+ },
48
+ };
49
+ }
9
50
 
10
- static get properties() {
11
- return {
12
- ...super.properties,
13
- /**
14
- * The user which created the codepen
15
- */
16
- user: {
17
- type: String
18
- },
19
- /**
20
- * Identifies the pen
21
- */
22
- hash: {
23
- type: String
24
- },
25
- /**
26
- * Height of the iframe in pixel
27
- */
28
- height: {
29
- type: Number
30
- },
31
- /**
32
- * Either 'dark' or 'light'
33
- */
34
- theme: {
35
- type: String
36
- },
37
- /**
38
- * If set, the codepen will not load before being
39
- * clicked by the user
40
- */
41
- preview: {
42
- type: Boolean
43
- },
44
- /**
45
- * Make the codepen editable (requires paid account)
46
- */
47
- editable: {
48
- type: Boolean
49
- }
50
- };
51
- }
51
+ constructor() {
52
+ super();
53
+ this.height = 256;
54
+ this.theme = 'light';
55
+ }
52
56
 
53
- constructor() {
54
- super();
55
- this.height = 256;
56
- this.theme = 'light';
57
+ render() {
58
+ let params = `height=${this.height}&theme-id=${this.theme}&default-tab=html,result`;
59
+ if (this.editable) {
60
+ params = `${params}&editable=true`;
57
61
  }
62
+ const url = `https://codepen.io/${this.user}/embed/${this.preview ? 'preview/' : ''}${
63
+ this.hash
64
+ }?${params}`;
65
+ return html`
66
+ <iframe
67
+ height="${this.height}"
68
+ scrolling="no"
69
+ title="${this.labe}l"
70
+ src="${url}"
71
+ frameborder="no"
72
+ allowtransparency="true"
73
+ allowfullscreen
74
+ >
75
+ Loading codepen ...
76
+ </iframe>
77
+ `;
78
+ }
58
79
 
59
- render() {
60
- let params = `height=${this.height}&theme-id=${this.theme}&default-tab=html,result`;
61
- if (this.editable) {
62
- params = `${params}&editable=true`;
63
- }
64
- const url = `https://codepen.io/${this.user}/embed/${this.preview ? 'preview/' : ''}${this.hash}?${params}`;
65
- return html`
66
- <iframe height="${this.height}" scrolling="no" title="${this.labe}l"
67
- src="${url}" frameborder="no" allowtransparency="true" allowfullscreen>
68
- Loading codepen ...
69
- </iframe>
70
- `;
71
- }
80
+ static get styles() {
81
+ return css`
82
+ :host {
83
+ display: block;
84
+ }
72
85
 
73
- static get styles() {
74
- return css`
75
- :host {
76
- display: block;
77
- }
78
-
79
- iframe {
80
- width: 100%;
81
- }
82
- `;
83
- }
86
+ iframe {
87
+ width: 100%;
88
+ }
89
+ `;
90
+ }
84
91
  }
85
- customElements.define('pb-codepen', PbCodepen);
92
+ customElements.define('pb-codepen', PbCodepen);