@blockquote-web-components/blockquote-base-embedded-webview 1.10.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockquote-web-components/blockquote-base-embedded-webview",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"description": "Webcomponent blockquote-base-embedded-webview following open-wc recommendations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lit",
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
"build": "echo \"This is not a TypeScript project, so no need to build.\"",
|
|
71
71
|
"dev:vite": "vite build",
|
|
72
72
|
"format": "npm run format:eslint && npm run format:prettier && npm run format:stylelint",
|
|
73
|
-
"format:eslint": "eslint
|
|
74
|
-
"format:prettier": "prettier \"**/*.{js,ts,json,html}\" --write --ignore-path .
|
|
75
|
-
"format:stylelint": "stylelint \"**/*.{scss,css}\" --fix --allow-empty-input --ignore-path .
|
|
73
|
+
"format:eslint": "eslint . --fix",
|
|
74
|
+
"format:prettier": "prettier \"**/*.{js,ts,json,html}\" --write --ignore-path .prettierignore",
|
|
75
|
+
"format:stylelint": "stylelint \"**/*.{scss,css}\" --fix --allow-empty-input --ignore-path .prettierignore",
|
|
76
76
|
"postinstall": "npm run sort:package",
|
|
77
77
|
"lint": "npm run lint:eslint && npm run lint:prettier && npm run lint:stylelint",
|
|
78
|
-
"lint:eslint": "eslint
|
|
79
|
-
"lint:prettier": "prettier \"**/*.{js,ts,json,html}\" --check --ignore-path .
|
|
80
|
-
"lint:stylelint": "stylelint \"**/*.{scss,css}\" --allow-empty-input --ignore-path .
|
|
78
|
+
"lint:eslint": "eslint .",
|
|
79
|
+
"lint:prettier": "prettier \"**/*.{js,ts,json,html}\" --check --ignore-path .prettierignore",
|
|
80
|
+
"lint:stylelint": "stylelint \"**/*.{scss,css}\" --allow-empty-input --ignore-path .prettierignore",
|
|
81
81
|
"preview:vite": "vite preview",
|
|
82
82
|
"sass:watch": "sass-style-template",
|
|
83
83
|
"sort:package": "npx sort-package-json",
|
|
@@ -99,6 +99,8 @@
|
|
|
99
99
|
},
|
|
100
100
|
"prettier": {
|
|
101
101
|
"arrowParens": "avoid",
|
|
102
|
+
"bracketSameLine": true,
|
|
103
|
+
"htmlWhitespaceSensitivity": "ignore",
|
|
102
104
|
"printWidth": 100,
|
|
103
105
|
"singleQuote": true,
|
|
104
106
|
"trailingComma": "all",
|
|
@@ -112,58 +114,6 @@
|
|
|
112
114
|
}
|
|
113
115
|
]
|
|
114
116
|
},
|
|
115
|
-
"eslintConfig": {
|
|
116
|
-
"parserOptions": {
|
|
117
|
-
"ecmaVersion": "latest"
|
|
118
|
-
},
|
|
119
|
-
"extends": [
|
|
120
|
-
"@open-wc",
|
|
121
|
-
"prettier"
|
|
122
|
-
],
|
|
123
|
-
"rules": {
|
|
124
|
-
"class-methods-use-this": "off",
|
|
125
|
-
"indent": [
|
|
126
|
-
"error",
|
|
127
|
-
2,
|
|
128
|
-
{
|
|
129
|
-
"SwitchCase": 1,
|
|
130
|
-
"ignoredNodes": [
|
|
131
|
-
"PropertyDefinition",
|
|
132
|
-
"TemplateLiteral > *"
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
],
|
|
136
|
-
"no-unused-expressions": [
|
|
137
|
-
"error",
|
|
138
|
-
{
|
|
139
|
-
"allowShortCircuit": true,
|
|
140
|
-
"allowTernary": true
|
|
141
|
-
}
|
|
142
|
-
],
|
|
143
|
-
"object-curly-newline": "off",
|
|
144
|
-
"import/extensions": [
|
|
145
|
-
"error",
|
|
146
|
-
"always",
|
|
147
|
-
{
|
|
148
|
-
"ignorePackages": true
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
"import/no-extraneous-dependencies": [
|
|
152
|
-
"error",
|
|
153
|
-
{
|
|
154
|
-
"devDependencies": [
|
|
155
|
-
"**/test/**/*.{js,ts}",
|
|
156
|
-
"**/*.config.{js,ts,mjs,cjs}",
|
|
157
|
-
"**/*.conf.{js,ts,mjs,cjs}"
|
|
158
|
-
]
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
"import/no-unresolved": "off",
|
|
162
|
-
"import/prefer-default-export": "off",
|
|
163
|
-
"lit/no-classfield-shadowing": "off",
|
|
164
|
-
"lit/no-native-attributes": "off"
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
117
|
"stylelint": {
|
|
168
118
|
"extends": "stylelint-config-standard-scss",
|
|
169
119
|
"rules": {
|
|
@@ -177,12 +127,12 @@
|
|
|
177
127
|
"lit": "^3.1.1"
|
|
178
128
|
},
|
|
179
129
|
"devDependencies": {
|
|
180
|
-
"@blockquote-web-components/blockquote-base-common-dev-dependencies": "^1.
|
|
181
|
-
"@blockquote-web-components/blockquote-foundations-sass": "^1.1.
|
|
130
|
+
"@blockquote-web-components/blockquote-base-common-dev-dependencies": "^1.9.1",
|
|
131
|
+
"@blockquote-web-components/blockquote-foundations-sass": "^1.1.3"
|
|
182
132
|
},
|
|
183
133
|
"publishConfig": {
|
|
184
134
|
"access": "public"
|
|
185
135
|
},
|
|
186
136
|
"customElements": "custom-elements.json",
|
|
187
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "7edc86cd16ada68f0d940336b43bfc9ba9389b0a"
|
|
188
138
|
}
|
|
@@ -5,17 +5,18 @@ import '../define/blockquote-base-embedded-webview-resize.js';
|
|
|
5
5
|
import '../define/blockquote-base-embedded-webview-element.js';
|
|
6
6
|
import { styles } from './styles/blockquote-base-embedded-webview-styles.css.js';
|
|
7
7
|
|
|
8
|
-
const chevronDownIcon = html
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
>
|
|
17
|
-
|
|
18
|
-
</svg
|
|
8
|
+
const chevronDownIcon = html`
|
|
9
|
+
<svg
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
viewBox="0 0 24 24"
|
|
12
|
+
stroke-width="2"
|
|
13
|
+
stroke="currentcolor"
|
|
14
|
+
fill="none"
|
|
15
|
+
stroke-linecap="round"
|
|
16
|
+
stroke-linejoin="round">
|
|
17
|
+
<polyline points="6 9 12 15 18 9" />
|
|
18
|
+
</svg>
|
|
19
|
+
`;
|
|
19
20
|
|
|
20
21
|
// https://github.com/ChromeDevTools/devtools-frontend/blob/main/front_end/Images/src/open-externally.svg
|
|
21
22
|
const openExternallyIcon = html`
|
|
@@ -25,11 +26,9 @@ const openExternallyIcon = html`
|
|
|
25
26
|
fill="currentcolor"
|
|
26
27
|
preserveAspectRatio="xMidYMid meet"
|
|
27
28
|
focusable="false"
|
|
28
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
-
>
|
|
29
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
30
30
|
<path
|
|
31
|
-
d="M4.5 17C4.08333 17 3.72933 16.854 3.438 16.562C3.146 16.2707 3 15.9167 3 15.5V4.5C3 4.08333 3.146 3.72933 3.438 3.438C3.72933 3.146 4.08333 3 4.5 3H10V4.5H4.5V15.5H15.5V10H17V15.5C17 15.9167 16.854 16.2707 16.562 16.562C16.2707 16.854 15.9167 17 15.5 17H4.5ZM8.062 13L7 11.938L14.438 4.5H12V3H17V8H15.5V5.562L8.062 13Z"
|
|
32
|
-
/>
|
|
31
|
+
d="M4.5 17C4.08333 17 3.72933 16.854 3.438 16.562C3.146 16.2707 3 15.9167 3 15.5V4.5C3 4.08333 3.146 3.72933 3.438 3.438C3.72933 3.146 4.08333 3 4.5 3H10V4.5H4.5V15.5H15.5V10H17V15.5C17 15.9167 16.854 16.2707 16.562 16.562C16.2707 16.854 15.9167 17 15.5 17H4.5ZM8.062 13L7 11.938L14.438 4.5H12V3H17V8H15.5V5.562L8.062 13Z" />
|
|
33
32
|
</svg>
|
|
34
33
|
`;
|
|
35
34
|
|
|
@@ -217,7 +216,9 @@ export class BlockquoteBaseEmbeddedWebview extends LitElement {
|
|
|
217
216
|
}
|
|
218
217
|
|
|
219
218
|
render() {
|
|
220
|
-
return html`
|
|
219
|
+
return html`
|
|
220
|
+
${this._headerTpl} ${this._mainTpl} ${this._litHtmlRender()}
|
|
221
|
+
`;
|
|
221
222
|
}
|
|
222
223
|
|
|
223
224
|
_litHtmlRender() {
|
|
@@ -241,11 +242,15 @@ export class BlockquoteBaseEmbeddedWebview extends LitElement {
|
|
|
241
242
|
}
|
|
242
243
|
|
|
243
244
|
get _headingTpl() {
|
|
244
|
-
return html
|
|
245
|
+
return html`
|
|
246
|
+
<div aria-level="${this._headingLevel}" role="heading">${this.heading}</div>
|
|
247
|
+
`;
|
|
245
248
|
}
|
|
246
249
|
|
|
247
250
|
get _navigationDemosTpl() {
|
|
248
|
-
return html`
|
|
251
|
+
return html`
|
|
252
|
+
<div>${this._selectTpl}${this._externalLinkTpl}</div>
|
|
253
|
+
`;
|
|
249
254
|
}
|
|
250
255
|
|
|
251
256
|
get _selectTpl() {
|
|
@@ -270,14 +275,18 @@ export class BlockquoteBaseEmbeddedWebview extends LitElement {
|
|
|
270
275
|
}
|
|
271
276
|
|
|
272
277
|
get _externalLinkTpl() {
|
|
273
|
-
return html
|
|
274
|
-
<
|
|
275
|
-
|
|
276
|
-
|
|
278
|
+
return html`
|
|
279
|
+
<a href="${this._src || '#'}" target="_blank" class="open-externally">
|
|
280
|
+
<span class="sr-only">View demo in a new tab</span>
|
|
281
|
+
<span aria-hidden="true">${openExternallyIcon}</span>
|
|
282
|
+
</a>
|
|
283
|
+
`;
|
|
277
284
|
}
|
|
278
285
|
|
|
279
286
|
get _descriptionTpl() {
|
|
280
|
-
return html`
|
|
287
|
+
return html`
|
|
288
|
+
<p class="description">${this._sources[this.selected].description}</p>
|
|
289
|
+
`;
|
|
281
290
|
}
|
|
282
291
|
|
|
283
292
|
get _readDataPosTpl() {
|
|
@@ -285,8 +294,7 @@ export class BlockquoteBaseEmbeddedWebview extends LitElement {
|
|
|
285
294
|
<div
|
|
286
295
|
aria-hidden="true"
|
|
287
296
|
class="read-data-pos"
|
|
288
|
-
style="opacity:${this.__readDataPos.resizing ? 1 : 0}"
|
|
289
|
-
>
|
|
297
|
+
style="opacity:${this.__readDataPos.resizing ? 1 : 0}">
|
|
290
298
|
<span>${this.__readDataPos.x}</span>
|
|
291
299
|
<span>x</span>
|
|
292
300
|
<span>${this.__readDataPos.y}</span>
|
|
@@ -295,31 +303,33 @@ export class BlockquoteBaseEmbeddedWebview extends LitElement {
|
|
|
295
303
|
}
|
|
296
304
|
|
|
297
305
|
get _screenSizeTpl() {
|
|
298
|
-
return html`
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
306
|
+
return html`
|
|
307
|
+
<blockquote-base-embedded-webview-size
|
|
308
|
+
.disabledSelectedSizeText="${this.__resetResizing}"
|
|
309
|
+
@click="${this._updateSize}"
|
|
310
|
+
@selectedchange="${this._updateSize}"
|
|
311
|
+
.selected="${this.screenSizeSelected}"></blockquote-base-embedded-webview-size>
|
|
312
|
+
`;
|
|
304
313
|
}
|
|
305
314
|
|
|
306
315
|
get _mainTpl() {
|
|
307
316
|
return html`
|
|
308
317
|
<div class="main">
|
|
309
318
|
<blockquote-base-embedded-webview-resize ${ref(this._embeddedResizeRef)}>
|
|
310
|
-
<slot name="embedded"
|
|
319
|
+
<slot name="embedded">${this._embeddedSlotTpl}</slot>
|
|
311
320
|
</blockquote-base-embedded-webview-resize>
|
|
312
321
|
</div>
|
|
313
322
|
`;
|
|
314
323
|
}
|
|
315
324
|
|
|
316
325
|
get _embeddedSlotTpl() {
|
|
317
|
-
return html`
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
326
|
+
return html`
|
|
327
|
+
<blockquote-base-embedded-webview-element
|
|
328
|
+
slot="embedded"
|
|
329
|
+
.src="${this._src || ''}"
|
|
330
|
+
.embeddedTitle="${this._sources[this.selected].option ||
|
|
331
|
+
'Demo'}"></blockquote-base-embedded-webview-element>
|
|
332
|
+
`;
|
|
323
333
|
}
|
|
324
334
|
|
|
325
335
|
_onChangeFile({ target }) {
|
|
@@ -73,7 +73,9 @@ export class BlockquoteBaseEmbeddedWebviewElement extends LitElement {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
render() {
|
|
76
|
-
return html`
|
|
76
|
+
return html`
|
|
77
|
+
${this._embeddedTpl} ${this._litHtmlRender()}
|
|
78
|
+
`;
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
_litHtmlRender() {
|
|
@@ -89,7 +91,9 @@ export class BlockquoteBaseEmbeddedWebviewElement extends LitElement {
|
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
get _embeddedTpl() {
|
|
92
|
-
return html
|
|
94
|
+
return html`
|
|
95
|
+
<slot name="embedded"></slot>
|
|
96
|
+
`;
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
_fetch(resource) {
|
|
@@ -163,8 +163,8 @@ export class BlockquoteBaseEmbeddedWebviewSize extends LitElement {
|
|
|
163
163
|
get _toolbarTpl() {
|
|
164
164
|
return html`
|
|
165
165
|
${this.screenSizes.map(
|
|
166
|
-
(item, index) =>
|
|
167
|
-
|
|
166
|
+
(item, index) => html`
|
|
167
|
+
<button
|
|
168
168
|
@click="${this._setSelected}"
|
|
169
169
|
id="${item.id}"
|
|
170
170
|
data-index="${index + 1}"
|
|
@@ -172,18 +172,20 @@ export class BlockquoteBaseEmbeddedWebviewSize extends LitElement {
|
|
|
172
172
|
?hidden="${!this.showOverflowSize && item.width > this.computedStyleWidth}"
|
|
173
173
|
style="${this.widthInPercent
|
|
174
174
|
? `width: calc(100% / ${index + 1});`
|
|
175
|
-
: `width: ${item.width}px;`}"
|
|
176
|
-
>
|
|
175
|
+
: `width: ${item.width}px;`}">
|
|
177
176
|
<span>${item.id}</span>
|
|
178
|
-
</button
|
|
177
|
+
</button>
|
|
178
|
+
`,
|
|
179
179
|
)}
|
|
180
180
|
`;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
get _visualTextTpl() {
|
|
184
|
-
return html`
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
return html`
|
|
185
|
+
<span aria-disabled="${this.disabledSelectedSizeText}" aria-hidden="true">
|
|
186
|
+
${this.selectedSize.id}
|
|
187
|
+
</span>
|
|
188
|
+
`;
|
|
187
189
|
}
|
|
188
190
|
|
|
189
191
|
_onResize(ev) {
|
|
@@ -17,7 +17,7 @@ export const styles = css`:host {
|
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
align-items: center;
|
|
19
19
|
height: inherit;
|
|
20
|
-
padding: calc(var(--__resizer-factor) * 1) 0 calc(var(--__resizer-factor) * 2)
|
|
20
|
+
padding: calc(var(--__resizer-factor) * 1) 0 calc(var(--__resizer-factor) * 2);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
:host([hidden]),
|