tosijs-ui 1.15.2 → 1.15.3
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/CHANGELOG.md +76 -0
- package/bin/caddy-install.ts +0 -0
- package/bin/make-icon-data.js +4 -1
- package/bin/release-notes.ts +0 -0
- package/dist/dialog.d.ts +14 -2
- package/dist/dialog.js +87 -5
- package/dist/doc-system/site/build-stamp.d.ts +6 -1
- package/dist/doc-system/site/orchestrator.js +13 -1
- package/dist/doc-system/site/sourcemap-relocate.d.ts +7 -0
- package/dist/doc-system/site/sourcemap-relocate.js +50 -0
- package/dist/icon-data.d.ts +322 -1
- package/dist/icon-types.d.ts +14 -0
- package/dist/icons.d.ts +1 -0
- package/dist/iife.js +89 -89
- package/dist/iife.js.map +10 -9
- package/dist/markdown-viewer.d.ts +7 -0
- package/dist/markdown-viewer.js +83 -5
- package/dist/tag-list.js +9 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/llms.txt +1 -1
- package/package.json +4 -3
- package/dist/.metadata_never_index +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.15.3
|
|
4
|
+
|
|
5
|
+
### `<tosi-md sanitize="on">`, and a heads-up: it becomes the default in 1.16 (#179)
|
|
6
|
+
|
|
7
|
+
`<tosi-md>` assigns rendered markdown to the page, and markdown can carry raw HTML. For text you
|
|
8
|
+
did not write (issue bodies, comments, anything from a user or an API), that is a **stored
|
|
9
|
+
XSS**: tosijs-virta's pre-release review demonstrated reading a token out of `localStorage`
|
|
10
|
+
through an issue body with `<img onerror>`.
|
|
11
|
+
|
|
12
|
+
`sanitize="on"` strips executable content (scripts, event-handler attributes, unsafe URL
|
|
13
|
+
schemes) with [kilpi](https://www.npmjs.com/package/tosijs-kilpi), and drops any link that is
|
|
14
|
+
not safe to navigate to. It **removes some elements together with everything inside them**:
|
|
15
|
+
`script`, `style`, `iframe`, `object`, `embed`, `form`, `link`, `meta`, `base`, `noscript`,
|
|
16
|
+
`template` and SVG animation elements. So markdown that embeds a `<form>` needs `sanitize="off"`.
|
|
17
|
+
Markdown, ordinary links (relative, `#anchor`, `mailto:`), inputs and custom elements survive. A
|
|
18
|
+
bare `<tosi-md sanitize>` also means on.
|
|
19
|
+
|
|
20
|
+
**If you leave `sanitize` unset, nothing changes in this release** except one console warning
|
|
21
|
+
per page. **In 1.16 the default becomes `on`.** Set `sanitize="on"` or `sanitize="off"` now and
|
|
22
|
+
the upgrade will not affect you; `off` keeps raw HTML and is silent.
|
|
23
|
+
|
|
24
|
+
`tosijs-kilpi` is a new runtime dependency: +865 bytes gzip on `dist/iife.js`.
|
|
25
|
+
|
|
26
|
+
### Escape closes a `<tosi-dialog>` properly — `confirm`/`alert`/`prompt` no longer hang (#183)
|
|
27
|
+
|
|
28
|
+
Escape let the browser close the native `<dialog>` directly, bypassing `close()`. So
|
|
29
|
+
`await TosiDialog.confirm(...)` (and `alert`, `prompt`) **never settled**, the `showModal()`
|
|
30
|
+
promise never resolved, and a `removeOnClose` dialog stayed in the DOM, one leaked element per
|
|
31
|
+
Escape. Escape now closes with `'cancel'` through the same path as the Cancel button. So does
|
|
32
|
+
the browser closing the element on its own (a `<form method="dialog">`, or Chrome refusing a
|
|
33
|
+
repeated Escape), so nothing waits forever.
|
|
34
|
+
|
|
35
|
+
**New: `dialogWillClose` can refuse a close.** Return `false`, or a Promise of `false`, and the
|
|
36
|
+
dialog stays open, e.g. while an async save is in flight. `close()` now returns whether it
|
|
37
|
+
closed. Reported by snowfox-app, which carried a workaround at nine sites.
|
|
38
|
+
|
|
39
|
+
The default `dialogWillClose` no longer `console.log`s on every close, and the docs now say that
|
|
40
|
+
the built-in **OK** button sits beside footer buttons rather than being replaced by them.
|
|
41
|
+
|
|
42
|
+
### Icon types: `IconElement` is importable, and `icons.x()` needs no `!` (#176, #181)
|
|
43
|
+
|
|
44
|
+
- `IconElement`, `IconName` and `SVGIconMap` are exported from `tosijs-ui/icons`:
|
|
45
|
+
`import { icons, type IconElement } from 'tosijs-ui/icons'`. 1.15 widened the icon return
|
|
46
|
+
type from `SVGElement` to `SVGElement | HTMLSpanElement` (a composite icon is a span), and
|
|
47
|
+
there was no importable name for the new union.
|
|
48
|
+
- Under `noUncheckedIndexedAccess`, every `icons.user()` read as possibly undefined, forcing
|
|
49
|
+
`icons.user!()` everywhere. Built-in icon names are now explicit keys of the type, so the `!`
|
|
50
|
+
can go, and a misspelled `IconName` is a type error. Composites and `defineIcons()` names
|
|
51
|
+
still go through the index signature.
|
|
52
|
+
- `tosijs-make-icons` now generates `satisfies IconData` rather than `as IconData`, which keeps
|
|
53
|
+
icon names in the type system. **It needs TypeScript 4.9 or later** in the project that runs
|
|
54
|
+
it.
|
|
55
|
+
|
|
56
|
+
### `tagList.popSelectMenu` can be replaced after the element is on the page (#172)
|
|
57
|
+
|
|
58
|
+
The documented "replace this method" hook only worked if you replaced it before the element
|
|
59
|
+
connected, which `tosiTagList({...})` never allows: the button captured the original function.
|
|
60
|
+
It now looks the method up on every click.
|
|
61
|
+
|
|
62
|
+
### Doc-site sourcemaps no longer expose the build machine's paths
|
|
63
|
+
|
|
64
|
+
A doc site built with `bundleEntry` published sourcemaps whose sources climbed to the
|
|
65
|
+
filesystem root and into the builder's home directory (`../../../../../../Users/<name>/…`),
|
|
66
|
+
because the hydration bundle was built in the OS temp directory. The deployed site revealed
|
|
67
|
+
the build machine's directory layout, and two machines could not produce the same site. The
|
|
68
|
+
bundle is now built under your project's `node_modules/.cache`, and its maps are rewritten to
|
|
69
|
+
point at the sources from where they are served, so devtools find them and every machine
|
|
70
|
+
builds identical output. Rebuild your site to replace the old maps.
|
|
71
|
+
|
|
72
|
+
### `/version.json`: what `commit` means (#180)
|
|
73
|
+
|
|
74
|
+
Documentation only. Since #122, a content-identical rebuild keeps the previous stamp, so `commit`
|
|
75
|
+
is the last commit whose build *changed the site*, and can be older than `HEAD`. To check that
|
|
76
|
+
committed output matches `HEAD`, rebuild and confirm the tree is clean. `doc-site-system.md` now
|
|
77
|
+
says so and shows `contentHash`.
|
|
78
|
+
|
|
3
79
|
## 1.15.2
|
|
4
80
|
|
|
5
81
|
### The `tjs-lang` peer admits 0.14.x (#182)
|
package/bin/caddy-install.ts
CHANGED
|
File without changes
|
package/bin/make-icon-data.js
CHANGED
|
@@ -414,7 +414,10 @@ let source =
|
|
|
414
414
|
(typeDeclaration ? typeDeclaration + '\n\n' : '') +
|
|
415
415
|
'export default ' +
|
|
416
416
|
emitObject(iconData) +
|
|
417
|
-
|
|
417
|
+
// `satisfies`, not `as`: `as IconData` widened the keys to `string`, so the icon NAMES were
|
|
418
|
+
// lost to the type system and `icons.user` read as possibly-undefined under
|
|
419
|
+
// noUncheckedIndexedAccess (#181). `satisfies` checks the shape and keeps the names.
|
|
420
|
+
(isTypescript ? ' satisfies IconData\n' : '\n')
|
|
418
421
|
|
|
419
422
|
/*
|
|
420
423
|
If prettier is resolvable, let it have the last word — it picks up the CONSUMER's own
|
package/bin/release-notes.ts
CHANGED
|
File without changes
|
package/dist/dialog.d.ts
CHANGED
|
@@ -51,10 +51,22 @@ export declare class TosiDialog extends Component<DialogParts> {
|
|
|
51
51
|
removeOnClose: boolean;
|
|
52
52
|
closeOnBackgroundClick: boolean;
|
|
53
53
|
constructor();
|
|
54
|
-
|
|
54
|
+
/**
|
|
55
|
+
Called before the dialog closes, with the reason (`'confirm'`, `'cancel'`, or whatever was
|
|
56
|
+
passed to `close()`). Return `false` — or a Promise resolving to `false` — to refuse the
|
|
57
|
+
close, e.g. while an async save is in flight: a dialog that cannot be cancelled must not
|
|
58
|
+
look as though it was.
|
|
59
|
+
*/
|
|
60
|
+
dialogWillClose: (_reason?: string) => void | boolean | Promise<void | boolean>;
|
|
55
61
|
initialFocus(): void;
|
|
56
62
|
showModal: () => Promise<string | null>;
|
|
57
|
-
|
|
63
|
+
/**
|
|
64
|
+
Close the dialog unless `dialogWillClose` vetoes it. Returns whether it closed — a Promise
|
|
65
|
+
of that when `dialogWillClose` is async.
|
|
66
|
+
*/
|
|
67
|
+
close: (reason?: string) => boolean | Promise<boolean>;
|
|
68
|
+
onCancel: (event: Event) => void;
|
|
69
|
+
onNativeClose: () => void;
|
|
58
70
|
ok: () => void;
|
|
59
71
|
content: () => HTMLDialogElement;
|
|
60
72
|
}
|
package/dist/dialog.js
CHANGED
|
@@ -43,6 +43,32 @@ test('dialog has header slot content', () => {
|
|
|
43
43
|
})
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
The dialog always supplies its own **OK** button (`part="ok"`, which closes with
|
|
47
|
+
`'confirm'`). Buttons you put in the `footer` slot appear **beside** it, not instead of it, so
|
|
48
|
+
add a Cancel button there, not a second OK.
|
|
49
|
+
|
|
50
|
+
## Closing
|
|
51
|
+
|
|
52
|
+
Every way a dialog closes — the OK button, `close(reason)`, a background click when
|
|
53
|
+
`closeOnBackgroundClick` is set, **Escape**, or a `<form method="dialog">` — goes through the
|
|
54
|
+
same path: `dialogWillClose(reason)` is called, the `showModal()` promise resolves with the
|
|
55
|
+
reason, and a `removeOnClose` dialog removes itself. Escape closes with `'cancel'`.
|
|
56
|
+
|
|
57
|
+
`dialogWillClose` can **refuse** a close by returning `false`, or a Promise resolving to
|
|
58
|
+
`false`. Use it for a dialog that must not be dismissed while it is busy, such as an async save
|
|
59
|
+
in flight. `close()` returns whether the dialog closed, or a Promise of that when
|
|
60
|
+
`dialogWillClose` is async.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
const editor = tosiDialog({
|
|
64
|
+
dialogWillClose: () => !saving, // Escape and Cancel do nothing mid-save
|
|
65
|
+
})
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The browser can close a `<dialog>` without asking (a `<form method="dialog">` submission, or a
|
|
69
|
+
repeated Escape without fresh user interaction in Chrome). Those cannot be refused; the dialog
|
|
70
|
+
still calls `dialogWillClose` and resolves, so nothing waits forever.
|
|
71
|
+
|
|
46
72
|
## Static Functions
|
|
47
73
|
|
|
48
74
|
`TosiDialog` provides static async functions to replace the built-in dialogs provided by
|
|
@@ -232,8 +258,14 @@ export class TosiDialog extends Component {
|
|
|
232
258
|
}
|
|
233
259
|
});
|
|
234
260
|
}
|
|
235
|
-
|
|
236
|
-
|
|
261
|
+
/**
|
|
262
|
+
Called before the dialog closes, with the reason (`'confirm'`, `'cancel'`, or whatever was
|
|
263
|
+
passed to `close()`). Return `false` — or a Promise resolving to `false` — to refuse the
|
|
264
|
+
close, e.g. while an async save is in flight: a dialog that cannot be cancelled must not
|
|
265
|
+
look as though it was.
|
|
266
|
+
*/
|
|
267
|
+
dialogWillClose = (_reason = 'cancel') => {
|
|
268
|
+
/* override to observe or veto */
|
|
237
269
|
};
|
|
238
270
|
initialFocus() {
|
|
239
271
|
this.parts.ok.focus();
|
|
@@ -241,8 +273,16 @@ export class TosiDialog extends Component {
|
|
|
241
273
|
#modalResolution = (_outcome) => {
|
|
242
274
|
/* noop */
|
|
243
275
|
};
|
|
276
|
+
/*
|
|
277
|
+
True once this showing's close side effects have run — resolution, removal — so that no path
|
|
278
|
+
runs them twice. Every route to "closed" funnels into #finish, and there are three: close()
|
|
279
|
+
(buttons, background click, callers), Escape (the native `cancel`), and the browser closing
|
|
280
|
+
the element on its own (the native `close` event, below).
|
|
281
|
+
*/
|
|
282
|
+
#settled = false;
|
|
244
283
|
showModal = () => {
|
|
245
284
|
this.style.zIndex = String(findHighestZ());
|
|
285
|
+
this.#settled = false;
|
|
246
286
|
return new Promise((resolve) => {
|
|
247
287
|
this.#modalResolution = resolve;
|
|
248
288
|
this.parts.dialog.showModal();
|
|
@@ -251,17 +291,59 @@ export class TosiDialog extends Component {
|
|
|
251
291
|
});
|
|
252
292
|
});
|
|
253
293
|
};
|
|
294
|
+
/**
|
|
295
|
+
Close the dialog unless `dialogWillClose` vetoes it. Returns whether it closed — a Promise
|
|
296
|
+
of that when `dialogWillClose` is async.
|
|
297
|
+
*/
|
|
254
298
|
close = (reason = 'cancel') => {
|
|
255
|
-
this
|
|
299
|
+
if (this.#settled) {
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
const verdict = this.dialogWillClose(reason);
|
|
303
|
+
if (verdict instanceof Promise) {
|
|
304
|
+
return verdict.then((v) => (v === false ? false : this.#finish(reason)));
|
|
305
|
+
}
|
|
306
|
+
return verdict === false ? false : this.#finish(reason);
|
|
307
|
+
};
|
|
308
|
+
#finish(reason) {
|
|
309
|
+
if (this.#settled) {
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
this.#settled = true;
|
|
256
313
|
this.#modalResolution(reason);
|
|
257
|
-
this.parts.dialog.
|
|
314
|
+
if (this.parts.dialog.open) {
|
|
315
|
+
this.parts.dialog.close();
|
|
316
|
+
}
|
|
258
317
|
if (this.removeOnClose) {
|
|
259
318
|
this.remove();
|
|
260
319
|
}
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
/*
|
|
323
|
+
Escape (#183). The browser would close the <dialog> itself and bypass close(), so the static
|
|
324
|
+
helpers never resolved and removeOnClose leaked the element. Take the close over instead,
|
|
325
|
+
which is also what lets dialogWillClose veto it.
|
|
326
|
+
*/
|
|
327
|
+
onCancel = (event) => {
|
|
328
|
+
event.preventDefault();
|
|
329
|
+
this.close('cancel');
|
|
330
|
+
};
|
|
331
|
+
/*
|
|
332
|
+
The browser can still close the element without asking: Chrome's close-watcher makes a repeat
|
|
333
|
+
`cancel` non-cancelable without fresh user activation, and `<form method="dialog">` closes it
|
|
334
|
+
directly. Too late to veto, so tell dialogWillClose and settle, rather than hang the caller.
|
|
335
|
+
*/
|
|
336
|
+
onNativeClose = () => {
|
|
337
|
+
if (this.#settled) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const reason = this.parts.dialog.returnValue || 'cancel';
|
|
341
|
+
this.dialogWillClose(reason);
|
|
342
|
+
this.#finish(reason);
|
|
261
343
|
};
|
|
262
344
|
ok = () => {
|
|
263
345
|
this.close('confirm');
|
|
264
346
|
};
|
|
265
|
-
content = () => dialog({ part: 'dialog' }, header(tosiSlot({ name: 'header' })), tosiSlot(), footer(tosiSlot({ name: 'footer' }), button({ part: 'ok', onClick: this.ok }, 'OK')));
|
|
347
|
+
content = () => dialog({ part: 'dialog', onCancel: this.onCancel, onClose: this.onNativeClose }, header(tosiSlot({ name: 'header' })), tosiSlot(), footer(tosiSlot({ name: 'footer' }), button({ part: 'ok', onClick: this.ok }, 'OK')));
|
|
266
348
|
}
|
|
267
349
|
export const tosiDialog = TosiDialog.elementCreator();
|
|
@@ -3,7 +3,12 @@ export interface BuildStamp {
|
|
|
3
3
|
generator: string;
|
|
4
4
|
/** the project's name, from site config */
|
|
5
5
|
site?: string;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Short hash of the last commit whose build CHANGED the site's content, when available.
|
|
8
|
+
* A content-identical rebuild keeps the previous value (see `stampToWrite`, #122), so this
|
|
9
|
+
* can be older than HEAD — to check committed output matches HEAD, rebuild and check the
|
|
10
|
+
* tree is clean instead (#180).
|
|
11
|
+
*/
|
|
7
12
|
commit?: string;
|
|
8
13
|
/** ISO-8601 commit timestamp, when available */
|
|
9
14
|
commitTime?: string;
|
|
@@ -20,6 +20,7 @@ import { existsSync, mkdirSync, unlinkSync } from 'fs';
|
|
|
20
20
|
import { tmpdir } from 'os';
|
|
21
21
|
import { $, spawn } from 'bun';
|
|
22
22
|
import { extractDocs } from './docs.js';
|
|
23
|
+
import { relocateSourcemaps } from './sourcemap-relocate.js';
|
|
23
24
|
import { checkExamples, formatExampleProblems, } from './check-examples.js';
|
|
24
25
|
import { ensureSections } from './sections.js';
|
|
25
26
|
import { generateLlmsTxt } from './make-llms-txt.js';
|
|
@@ -951,8 +952,17 @@ export async function buildSite(config, opts = {}) {
|
|
|
951
952
|
Build it in a temp dir instead. The only consumer is the copy into PUBLIC on the
|
|
952
953
|
next line, so nothing needs it to persist — and a temp dir cannot be swept into a
|
|
953
954
|
published tarball by a broad `files` entry.
|
|
955
|
+
|
|
956
|
+
Not the OS temp dir, though. `bun build` writes each sourcemap `sources` entry relative
|
|
957
|
+
to the OUTPUT dir, so from /tmp every path climbed to `/` and back down into the builder's
|
|
958
|
+
home — `../../../../../../Users/<name>/<project>/node_modules/…`. That published the
|
|
959
|
+
build machine's layout in every chunk map, and made docs/ differ between any two
|
|
960
|
+
machines, which failed the publish workflow's rebuild check (#178). Under the project's
|
|
961
|
+
own node_modules/.cache the paths are project-relative, so identical everywhere, and it
|
|
962
|
+
is equally out of reach of a `files` entry.
|
|
954
963
|
*/
|
|
955
|
-
const HYDRATE_DIR =
|
|
964
|
+
const HYDRATE_DIR = path.resolve(PROJECT_ROOT, 'node_modules/.cache', `tosijs-hydrate-${process.pid}`);
|
|
965
|
+
mkdirSync(path.dirname(HYDRATE_DIR), { recursive: true });
|
|
956
966
|
await $ `rm -rf ${HYDRATE_DIR}`.text().catch(() => { });
|
|
957
967
|
const esm = spawn([
|
|
958
968
|
'bun',
|
|
@@ -998,6 +1008,8 @@ export async function buildSite(config, opts = {}) {
|
|
|
998
1008
|
// Copy the whole ESM output (entry + hashed chunks) to the served root — the entry
|
|
999
1009
|
// imports its chunks by RELATIVE path, so they must sit right beside it.
|
|
1000
1010
|
await $ `cp -R ${HYDRATE_DIR}/. ${PUBLIC}/`.text();
|
|
1011
|
+
// The copy moved every map; re-point their sources from where they now sit (#178).
|
|
1012
|
+
relocateSourcemaps(HYDRATE_DIR, PUBLIC);
|
|
1001
1013
|
hydrateName = 'hydrate.js';
|
|
1002
1014
|
/*
|
|
1003
1015
|
`bundleEntry` REPLACES our bundle rather than extending it, and an entry that forgets
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Re-express one map's sources, as if the map moved from `fromDir` to `toDir`. */
|
|
2
|
+
export declare function relocateSources(sources: string[], fromDir: string, toDir: string): string[];
|
|
3
|
+
/**
|
|
4
|
+
* For every `.map` under `builtDir`, write a copy at the same relative path under
|
|
5
|
+
* `servedDir` with its `sources` rewritten for that location.
|
|
6
|
+
*/
|
|
7
|
+
export declare function relocateSourcemaps(builtDir: string, servedDir: string): void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Rewrite sourcemaps for a bundle that is BUILT in one directory and SERVED from another.
|
|
3
|
+
|
|
4
|
+
`bun build` writes each `sources` entry relative to the output directory. The hydration bundle
|
|
5
|
+
is built outside the served tree (so it can never be swept into a published `dist/`, #31) and
|
|
6
|
+
then copied into it, which leaves every relative path pointing somewhere else. Built in the OS
|
|
7
|
+
temp dir, those paths climbed to `/` and into the builder's home directory — publishing the
|
|
8
|
+
machine's layout and making the site differ between machines (#178).
|
|
9
|
+
|
|
10
|
+
For each `.map` under `builtDir`, this re-expresses every source relative to the map's place
|
|
11
|
+
under `servedDir`. The result is correct for devtools, identical on every machine, and
|
|
12
|
+
names no home directory. Virtual sources (`bun:…`, `data:…`) are left alone.
|
|
13
|
+
*/
|
|
14
|
+
import { readdirSync, readFileSync, statSync, writeFileSync } from 'fs';
|
|
15
|
+
import * as path from 'path';
|
|
16
|
+
function mapsUnder(dir) {
|
|
17
|
+
const out = [];
|
|
18
|
+
for (const name of readdirSync(dir)) {
|
|
19
|
+
const full = path.join(dir, name);
|
|
20
|
+
if (statSync(full).isDirectory())
|
|
21
|
+
out.push(...mapsUnder(full));
|
|
22
|
+
else if (name.endsWith('.map'))
|
|
23
|
+
out.push(full);
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
/** Re-express one map's sources, as if the map moved from `fromDir` to `toDir`. */
|
|
28
|
+
export function relocateSources(sources, fromDir, toDir) {
|
|
29
|
+
return sources.map((source) => /^[a-z][a-z0-9+.-]*:/i.test(source)
|
|
30
|
+
? source
|
|
31
|
+
: path
|
|
32
|
+
.relative(toDir, path.resolve(fromDir, source))
|
|
33
|
+
.split(path.sep)
|
|
34
|
+
.join('/'));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* For every `.map` under `builtDir`, write a copy at the same relative path under
|
|
38
|
+
* `servedDir` with its `sources` rewritten for that location.
|
|
39
|
+
*/
|
|
40
|
+
export function relocateSourcemaps(builtDir, servedDir) {
|
|
41
|
+
for (const map of mapsUnder(builtDir)) {
|
|
42
|
+
const rel = path.relative(builtDir, map);
|
|
43
|
+
const target = path.join(servedDir, rel);
|
|
44
|
+
const json = JSON.parse(readFileSync(map, 'utf8'));
|
|
45
|
+
if (Array.isArray(json.sources)) {
|
|
46
|
+
json.sources = relocateSources(json.sources, path.dirname(map), path.dirname(target));
|
|
47
|
+
}
|
|
48
|
+
writeFileSync(target, JSON.stringify(json));
|
|
49
|
+
}
|
|
50
|
+
}
|
package/dist/icon-data.d.ts
CHANGED
|
@@ -1,5 +1,326 @@
|
|
|
1
1
|
export interface IconData {
|
|
2
2
|
[key: string]: string;
|
|
3
3
|
}
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: {
|
|
5
|
+
blueprint: string;
|
|
6
|
+
earth: string;
|
|
7
|
+
cmy: string;
|
|
8
|
+
rgb: string;
|
|
9
|
+
xrColor: string;
|
|
10
|
+
tosiFavicon: string;
|
|
11
|
+
tosiPlatform: string;
|
|
12
|
+
tosiUi: string;
|
|
13
|
+
tosiXr: string;
|
|
14
|
+
tosi: string;
|
|
15
|
+
discord: string;
|
|
16
|
+
facebook: string;
|
|
17
|
+
game: string;
|
|
18
|
+
google: string;
|
|
19
|
+
npm: string;
|
|
20
|
+
youtube: string;
|
|
21
|
+
blog: string;
|
|
22
|
+
bug: string;
|
|
23
|
+
activity: string;
|
|
24
|
+
airplay: string;
|
|
25
|
+
alertCircle: string;
|
|
26
|
+
alertOctagon: string;
|
|
27
|
+
alertTriangle: string;
|
|
28
|
+
alignCenter: string;
|
|
29
|
+
alignJustify: string;
|
|
30
|
+
alignLeft: string;
|
|
31
|
+
alignRight: string;
|
|
32
|
+
anchor: string;
|
|
33
|
+
aperture: string;
|
|
34
|
+
archive: string;
|
|
35
|
+
arrowUpRight: string;
|
|
36
|
+
atSign: string;
|
|
37
|
+
award: string;
|
|
38
|
+
barChart2: string;
|
|
39
|
+
barChart: string;
|
|
40
|
+
batteryCharging: string;
|
|
41
|
+
battery: string;
|
|
42
|
+
bellOff: string;
|
|
43
|
+
bell: string;
|
|
44
|
+
bluetooth: string;
|
|
45
|
+
bold: string;
|
|
46
|
+
bookOpen: string;
|
|
47
|
+
book: string;
|
|
48
|
+
bookmark: string;
|
|
49
|
+
box: string;
|
|
50
|
+
briefcase: string;
|
|
51
|
+
calendar: string;
|
|
52
|
+
cameraOff: string;
|
|
53
|
+
camera: string;
|
|
54
|
+
cast: string;
|
|
55
|
+
checkCircle: string;
|
|
56
|
+
checkSquare: string;
|
|
57
|
+
check: string;
|
|
58
|
+
chrome: string;
|
|
59
|
+
circle: string;
|
|
60
|
+
clipboard: string;
|
|
61
|
+
clock: string;
|
|
62
|
+
cloudDrizzle: string;
|
|
63
|
+
cloudLightning: string;
|
|
64
|
+
cloudOff: string;
|
|
65
|
+
cloudRain: string;
|
|
66
|
+
cloudSnow: string;
|
|
67
|
+
cloud: string;
|
|
68
|
+
code: string;
|
|
69
|
+
codepen: string;
|
|
70
|
+
codesandbox: string;
|
|
71
|
+
coffee: string;
|
|
72
|
+
columns: string;
|
|
73
|
+
command: string;
|
|
74
|
+
compass: string;
|
|
75
|
+
copy: string;
|
|
76
|
+
cpu: string;
|
|
77
|
+
creditCard: string;
|
|
78
|
+
crop: string;
|
|
79
|
+
crosshair: string;
|
|
80
|
+
database: string;
|
|
81
|
+
delete: string;
|
|
82
|
+
disc: string;
|
|
83
|
+
divideCircle: string;
|
|
84
|
+
divideSquare: string;
|
|
85
|
+
divide: string;
|
|
86
|
+
dollarSign: string;
|
|
87
|
+
downloadCloud: string;
|
|
88
|
+
download: string;
|
|
89
|
+
dribbble: string;
|
|
90
|
+
droplet: string;
|
|
91
|
+
edit2: string;
|
|
92
|
+
edit3: string;
|
|
93
|
+
edit: string;
|
|
94
|
+
externalLink: string;
|
|
95
|
+
eyeOff: string;
|
|
96
|
+
eye: string;
|
|
97
|
+
fastForward: string;
|
|
98
|
+
feather: string;
|
|
99
|
+
figma: string;
|
|
100
|
+
fileMinus: string;
|
|
101
|
+
filePlus: string;
|
|
102
|
+
fileText: string;
|
|
103
|
+
file: string;
|
|
104
|
+
film: string;
|
|
105
|
+
filter: string;
|
|
106
|
+
flag: string;
|
|
107
|
+
folderMinus: string;
|
|
108
|
+
folderPlus: string;
|
|
109
|
+
folder: string;
|
|
110
|
+
framer: string;
|
|
111
|
+
frown: string;
|
|
112
|
+
gift: string;
|
|
113
|
+
gitBranch: string;
|
|
114
|
+
gitCommit: string;
|
|
115
|
+
gitMerge: string;
|
|
116
|
+
gitPullRequest: string;
|
|
117
|
+
github: string;
|
|
118
|
+
gitlab: string;
|
|
119
|
+
globe: string;
|
|
120
|
+
grid: string;
|
|
121
|
+
hardDrive: string;
|
|
122
|
+
hash: string;
|
|
123
|
+
headphones: string;
|
|
124
|
+
heart: string;
|
|
125
|
+
helpCircle: string;
|
|
126
|
+
hexagon: string;
|
|
127
|
+
home: string;
|
|
128
|
+
image: string;
|
|
129
|
+
inbox: string;
|
|
130
|
+
info: string;
|
|
131
|
+
instagram: string;
|
|
132
|
+
italic: string;
|
|
133
|
+
key: string;
|
|
134
|
+
layers: string;
|
|
135
|
+
layout: string;
|
|
136
|
+
lifeBuoy: string;
|
|
137
|
+
link2: string;
|
|
138
|
+
link: string;
|
|
139
|
+
linkedin: string;
|
|
140
|
+
list: string;
|
|
141
|
+
loader: string;
|
|
142
|
+
lock: string;
|
|
143
|
+
logIn: string;
|
|
144
|
+
logOut: string;
|
|
145
|
+
mail: string;
|
|
146
|
+
mapPin: string;
|
|
147
|
+
map: string;
|
|
148
|
+
maximize2: string;
|
|
149
|
+
maximize: string;
|
|
150
|
+
meh: string;
|
|
151
|
+
menu: string;
|
|
152
|
+
messageCircle: string;
|
|
153
|
+
messageSquare: string;
|
|
154
|
+
micOff: string;
|
|
155
|
+
mic: string;
|
|
156
|
+
minimize2: string;
|
|
157
|
+
minimize: string;
|
|
158
|
+
minusCircle: string;
|
|
159
|
+
minusSquare: string;
|
|
160
|
+
minus: string;
|
|
161
|
+
monitor: string;
|
|
162
|
+
moon: string;
|
|
163
|
+
moreHorizontal: string;
|
|
164
|
+
moreVertical: string;
|
|
165
|
+
mousePointer: string;
|
|
166
|
+
move: string;
|
|
167
|
+
music: string;
|
|
168
|
+
navigation2: string;
|
|
169
|
+
navigation: string;
|
|
170
|
+
octagon: string;
|
|
171
|
+
package: string;
|
|
172
|
+
paperclip: string;
|
|
173
|
+
pauseCircle: string;
|
|
174
|
+
pause: string;
|
|
175
|
+
penTool: string;
|
|
176
|
+
percent: string;
|
|
177
|
+
phoneCall: string;
|
|
178
|
+
phoneForwarded: string;
|
|
179
|
+
phoneIncoming: string;
|
|
180
|
+
phoneMissed: string;
|
|
181
|
+
phoneOff: string;
|
|
182
|
+
phoneOutgoing: string;
|
|
183
|
+
phone: string;
|
|
184
|
+
pieChart: string;
|
|
185
|
+
playCircle: string;
|
|
186
|
+
play: string;
|
|
187
|
+
plusCircle: string;
|
|
188
|
+
plusSquare: string;
|
|
189
|
+
plus: string;
|
|
190
|
+
pocket: string;
|
|
191
|
+
power: string;
|
|
192
|
+
printer: string;
|
|
193
|
+
radio: string;
|
|
194
|
+
repeat: string;
|
|
195
|
+
rewind: string;
|
|
196
|
+
cornerDownRight: string;
|
|
197
|
+
cornerRightDown: string;
|
|
198
|
+
cornerRightUp: string;
|
|
199
|
+
cornerUpRight: string;
|
|
200
|
+
refreshCw: string;
|
|
201
|
+
rotateCw: string;
|
|
202
|
+
skipForward: string;
|
|
203
|
+
toggleRight: string;
|
|
204
|
+
rss: string;
|
|
205
|
+
save: string;
|
|
206
|
+
scissors: string;
|
|
207
|
+
search: string;
|
|
208
|
+
send: string;
|
|
209
|
+
server: string;
|
|
210
|
+
settings: string;
|
|
211
|
+
share2: string;
|
|
212
|
+
share: string;
|
|
213
|
+
shieldOff: string;
|
|
214
|
+
shield: string;
|
|
215
|
+
shoppingBag: string;
|
|
216
|
+
shoppingCart: string;
|
|
217
|
+
shuffle: string;
|
|
218
|
+
sidebar: string;
|
|
219
|
+
slack: string;
|
|
220
|
+
slash: string;
|
|
221
|
+
sliders: string;
|
|
222
|
+
smartphone: string;
|
|
223
|
+
smile: string;
|
|
224
|
+
speaker: string;
|
|
225
|
+
square: string;
|
|
226
|
+
star: string;
|
|
227
|
+
stopCircle: string;
|
|
228
|
+
sun: string;
|
|
229
|
+
sunrise: string;
|
|
230
|
+
sunset: string;
|
|
231
|
+
table: string;
|
|
232
|
+
tablet: string;
|
|
233
|
+
tag: string;
|
|
234
|
+
target: string;
|
|
235
|
+
terminal: string;
|
|
236
|
+
thermometer: string;
|
|
237
|
+
tool: string;
|
|
238
|
+
trash2: string;
|
|
239
|
+
trash: string;
|
|
240
|
+
trello: string;
|
|
241
|
+
trendingDown: string;
|
|
242
|
+
trendingUp: string;
|
|
243
|
+
triangle: string;
|
|
244
|
+
truck: string;
|
|
245
|
+
tv: string;
|
|
246
|
+
twitch: string;
|
|
247
|
+
twitter: string;
|
|
248
|
+
type: string;
|
|
249
|
+
umbrella: string;
|
|
250
|
+
underline: string;
|
|
251
|
+
unlock: string;
|
|
252
|
+
thumbsUp: string;
|
|
253
|
+
arrowRightCircle: string;
|
|
254
|
+
arrowRight: string;
|
|
255
|
+
chevronRight: string;
|
|
256
|
+
chevronsRight: string;
|
|
257
|
+
uploadCloud: string;
|
|
258
|
+
upload: string;
|
|
259
|
+
userCheck: string;
|
|
260
|
+
userMinus: string;
|
|
261
|
+
userPlus: string;
|
|
262
|
+
userX: string;
|
|
263
|
+
user: string;
|
|
264
|
+
users: string;
|
|
265
|
+
videoOff: string;
|
|
266
|
+
video: string;
|
|
267
|
+
voicemail: string;
|
|
268
|
+
volume1: string;
|
|
269
|
+
volume2: string;
|
|
270
|
+
volumeX: string;
|
|
271
|
+
volume: string;
|
|
272
|
+
watch: string;
|
|
273
|
+
wifiOff: string;
|
|
274
|
+
wifi: string;
|
|
275
|
+
wind: string;
|
|
276
|
+
xCircle: string;
|
|
277
|
+
xOctagon: string;
|
|
278
|
+
xSquare: string;
|
|
279
|
+
x: string;
|
|
280
|
+
zapOff: string;
|
|
281
|
+
zap: string;
|
|
282
|
+
zoomIn: string;
|
|
283
|
+
zoomOut: string;
|
|
284
|
+
fontBold: string;
|
|
285
|
+
fontItalic: string;
|
|
286
|
+
fontUnderline: string;
|
|
287
|
+
indent: string;
|
|
288
|
+
listBullet: string;
|
|
289
|
+
listNumber: string;
|
|
290
|
+
outdent: string;
|
|
291
|
+
pin: string;
|
|
292
|
+
resize: string;
|
|
293
|
+
shift: string;
|
|
294
|
+
sortAscending: string;
|
|
295
|
+
sortDescending: string;
|
|
296
|
+
tab: string;
|
|
297
|
+
cornerDownLeft: string;
|
|
298
|
+
cornerLeftDown: string;
|
|
299
|
+
cornerLeftUp: string;
|
|
300
|
+
cornerUpLeft: string;
|
|
301
|
+
refreshCcw: string;
|
|
302
|
+
rotateCcw: string;
|
|
303
|
+
skipBack: string;
|
|
304
|
+
toggleLeft: string;
|
|
305
|
+
thumbsDown: string;
|
|
306
|
+
arrowDownCircle: string;
|
|
307
|
+
arrowLeftCircle: string;
|
|
308
|
+
arrowUpCircle: string;
|
|
309
|
+
arrowDown: string;
|
|
310
|
+
arrowLeft: string;
|
|
311
|
+
arrowUp: string;
|
|
312
|
+
chevronDown: string;
|
|
313
|
+
chevronLeft: string;
|
|
314
|
+
chevronUp: string;
|
|
315
|
+
chevronsDown: string;
|
|
316
|
+
chevronsLeft: string;
|
|
317
|
+
chevronsUp: string;
|
|
318
|
+
arrowDownRight: string;
|
|
319
|
+
arrowDownLeft: string;
|
|
320
|
+
arrowUpLeft: string;
|
|
321
|
+
fatArrowUp: string;
|
|
322
|
+
fatArrowRight: string;
|
|
323
|
+
fatArrowDown: string;
|
|
324
|
+
fatArrowLeft: string;
|
|
325
|
+
};
|
|
5
326
|
export default _default;
|