@node-projects/web-component-designer 0.0.270 → 0.0.272
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.
|
@@ -25,12 +25,12 @@ export function pointInRect(point, rect) {
|
|
|
25
25
|
return point.x >= rect.x && point.x <= rect.x + rect.width && point.y >= rect.y && point.y <= rect.y + rect.height;
|
|
26
26
|
}
|
|
27
27
|
export function removeTrailing(text, char) {
|
|
28
|
-
if (text.endsWith('/'))
|
|
28
|
+
if (text.endsWith(char ?? '/'))
|
|
29
29
|
return text.substring(0, text.length - 1);
|
|
30
30
|
return text;
|
|
31
31
|
}
|
|
32
32
|
export function removeLeading(text, char) {
|
|
33
|
-
if (text.startsWith('/'))
|
|
33
|
+
if (text.startsWith(char ?? '/'))
|
|
34
34
|
return text.substring(1);
|
|
35
35
|
return text;
|
|
36
36
|
}
|
|
@@ -236,6 +236,22 @@ export class NpmPackageLoader {
|
|
|
236
236
|
"default": "./feature.js"
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
|
+
|
|
240
|
+
"exports": {
|
|
241
|
+
".": {
|
|
242
|
+
"types": "./dist/index.d.ts",
|
|
243
|
+
"import": {
|
|
244
|
+
"browser": {
|
|
245
|
+
"development": "./dist/composed-offset-position.browser.mjs",
|
|
246
|
+
"default": "./dist/composed-offset-position.browser.min.mjs"
|
|
247
|
+
},
|
|
248
|
+
"default": "./dist/composed-offset-position.mjs"
|
|
249
|
+
},
|
|
250
|
+
"module": "./dist/composed-offset-position.esm.js",
|
|
251
|
+
"default": "./dist/composed-offset-position.umd.js"
|
|
252
|
+
},
|
|
253
|
+
"./package.json": "./package.json"
|
|
254
|
+
}
|
|
239
255
|
|
|
240
256
|
*/
|
|
241
257
|
/*
|
|
@@ -249,17 +265,40 @@ export class NpmPackageLoader {
|
|
|
249
265
|
return obj.browser;
|
|
250
266
|
if (obj?.import)
|
|
251
267
|
return obj.import;
|
|
268
|
+
if (obj?.module)
|
|
269
|
+
return obj.module;
|
|
252
270
|
if (obj?.default)
|
|
253
271
|
return obj.default;
|
|
254
272
|
return obj?.node;
|
|
255
273
|
};
|
|
274
|
+
/*
|
|
275
|
+
for support of this:
|
|
276
|
+
"exports": {
|
|
277
|
+
".": {
|
|
278
|
+
"types": "./dist/index.d.ts",
|
|
279
|
+
"import": {
|
|
280
|
+
"browser": {
|
|
281
|
+
"development": "./dist/composed-offset-position.browser.mjs",
|
|
282
|
+
"default": "./dist/composed-offset-position.browser.min.mjs"
|
|
283
|
+
},
|
|
284
|
+
*/
|
|
285
|
+
let getImportFlat = (obj) => {
|
|
286
|
+
let i = getImport(obj);
|
|
287
|
+
if (!(typeof i == 'string'))
|
|
288
|
+
i = getImport(i);
|
|
289
|
+
if (!(typeof i == 'string'))
|
|
290
|
+
i = getImport(i);
|
|
291
|
+
if (!(typeof i == 'string'))
|
|
292
|
+
i = null;
|
|
293
|
+
return i;
|
|
294
|
+
};
|
|
256
295
|
//Names to use: browser, import, default, node
|
|
257
|
-
let imp =
|
|
296
|
+
let imp = getImportFlat(packageJsonObj.exports);
|
|
258
297
|
if (imp) {
|
|
259
|
-
importMap.imports[packageJsonObj.name] = baseUrl + removeTrailing(imp, '/');
|
|
298
|
+
importMap.imports[packageJsonObj.name] = baseUrl + removeLeading(removeTrailing(imp, '/'), '.');
|
|
260
299
|
}
|
|
261
|
-
else if (imp =
|
|
262
|
-
importMap.imports[packageJsonObj.name] = baseUrl + removeTrailing(imp, '/');
|
|
300
|
+
else if (imp = getImportFlat(packageJsonObj.exports?.['.'])) {
|
|
301
|
+
importMap.imports[packageJsonObj.name] = baseUrl + removeLeading(removeTrailing(imp, '/'), '.');
|
|
263
302
|
}
|
|
264
303
|
}
|
|
265
304
|
let mainImport = packageJsonObj.main;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "A UI designer for Polymer apps",
|
|
3
3
|
"name": "@node-projects/web-component-designer",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.272",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"author": "",
|
|
@@ -16,27 +16,27 @@
|
|
|
16
16
|
"@node-projects/base-custom-webcomponent": "^0.13.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@adobe/css-tools": "4.3.
|
|
19
|
+
"@adobe/css-tools": "4.3.1",
|
|
20
20
|
"@node-projects/lean-he-esm": "^3.3.0",
|
|
21
21
|
"@node-projects/node-html-parser-esm": "^6.1.5",
|
|
22
22
|
"@papyrs/stylo": "^0.0.45",
|
|
23
|
-
"@types/codemirror": "^5.60.
|
|
23
|
+
"@types/codemirror": "^5.60.9",
|
|
24
24
|
"@types/css-tree": "^2.3.1",
|
|
25
|
-
"@types/jquery": "^3.5.
|
|
25
|
+
"@types/jquery": "^3.5.17",
|
|
26
26
|
"@types/jquery.fancytree": "0.0.7",
|
|
27
|
-
"@types/node": "^20.
|
|
28
|
-
"ace-builds": "^1.24.
|
|
27
|
+
"@types/node": "^20.5.6",
|
|
28
|
+
"ace-builds": "^1.24.1",
|
|
29
29
|
"codemirror": "^5.0.0",
|
|
30
30
|
"css-tree": "^2.3.1",
|
|
31
31
|
"esprima-next": "^5.8.4",
|
|
32
32
|
"html2canvas": "*",
|
|
33
|
-
"jest": "^29.6.
|
|
33
|
+
"jest": "^29.6.4",
|
|
34
34
|
"jquery": "^3.7.0",
|
|
35
35
|
"jquery.fancytree": "^2.38.3",
|
|
36
|
-
"mdn-data": "^2.0.
|
|
36
|
+
"mdn-data": "^2.0.33",
|
|
37
37
|
"monaco-editor": "^0.41.0",
|
|
38
38
|
"ts-jest": "^29.1.1",
|
|
39
|
-
"typescript": "^5.
|
|
39
|
+
"typescript": "^5.2.2",
|
|
40
40
|
"typescript-lit-html-plugin": "^0.9.0"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|