@charcoal-ui/icons 2.4.0 → 2.6.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.
@@ -0,0 +1,311 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+
8
+ // src/PixivIcon.ts
9
+ import warning from "warning";
10
+
11
+ // src/charcoalIconFiles.ts
12
+ import charcoalIconFiles from "@charcoal-ui/icon-files";
13
+ var charcoalIconFiles_default = charcoalIconFiles;
14
+ var KNOWN_ICON_FILES = Object.keys(
15
+ charcoalIconFiles
16
+ );
17
+ function isKnownIconFile(name) {
18
+ return name in charcoalIconFiles;
19
+ }
20
+
21
+ // src/loaders/PixivIconLoadError.ts
22
+ var PixivIconLoadError = class extends Error {
23
+ constructor(name, cause) {
24
+ const message = formatMessage(name, cause);
25
+ super(message, { cause });
26
+ this.name = "PixivIconLoadError";
27
+ Object.setPrototypeOf(this, new.target.prototype);
28
+ }
29
+ };
30
+ function formatMessage(name, cause) {
31
+ const message = `Failed to fetch <pixiv-icon name="${name}">`;
32
+ if (cause == null) {
33
+ return message;
34
+ }
35
+ if (cause instanceof Error) {
36
+ return `${message}: ${cause.toString()})`;
37
+ }
38
+ return `${message}: ${JSON.stringify(cause)})`;
39
+ }
40
+
41
+ // src/loaders/CharcoalIconFilesLoader.ts
42
+ var CharcoalIconFilesLoader = class {
43
+ _name;
44
+ _resultSvg = void 0;
45
+ _promise = void 0;
46
+ constructor(name) {
47
+ this._name = name;
48
+ }
49
+ get importIconFile() {
50
+ return charcoalIconFiles_default[this._name];
51
+ }
52
+ async fetch() {
53
+ if (this._resultSvg !== void 0) {
54
+ return this._resultSvg;
55
+ }
56
+ if (this._promise) {
57
+ return this._promise;
58
+ }
59
+ this._promise = this.importIconFile().then((svg) => {
60
+ this._resultSvg = svg;
61
+ return this._resultSvg;
62
+ }).catch((e) => {
63
+ throw new PixivIconLoadError(this._name, e);
64
+ }).finally(() => {
65
+ this._promise = void 0;
66
+ });
67
+ return this._promise;
68
+ }
69
+ };
70
+
71
+ // src/loaders/CustomIconLoader.ts
72
+ var CustomIconLoader = class {
73
+ _name;
74
+ _filePathOrUrl;
75
+ _resultSvg = void 0;
76
+ _promise = void 0;
77
+ constructor(name, filePathOrUrl) {
78
+ this._name = name;
79
+ this._filePathOrUrl = filePathOrUrl;
80
+ }
81
+ async fetch() {
82
+ if (this._resultSvg !== void 0) {
83
+ return this._resultSvg;
84
+ }
85
+ if (this._promise) {
86
+ return this._promise;
87
+ }
88
+ this._promise = fetch(this._filePathOrUrl).then((response) => {
89
+ if (!response.ok) {
90
+ throw new PixivIconLoadError(this._name, "Response is not ok");
91
+ }
92
+ return response.text();
93
+ }).then((svg) => {
94
+ this._resultSvg = svg;
95
+ return this._resultSvg;
96
+ }).catch((e) => {
97
+ if (e instanceof PixivIconLoadError) {
98
+ throw e;
99
+ }
100
+ throw new PixivIconLoadError(this._name, e);
101
+ }).finally(() => {
102
+ this._promise = void 0;
103
+ });
104
+ return this._promise;
105
+ }
106
+ };
107
+
108
+ // src/loaders/index.ts
109
+ var loaders = /* @__PURE__ */ new Map();
110
+ function addCustomIcon(name, filePathOrUrl) {
111
+ loaders.set(name, new CustomIconLoader(name, filePathOrUrl));
112
+ }
113
+ async function getIcon(name) {
114
+ const loader = resolveIconLoader(name);
115
+ if (loader == null) {
116
+ throw new PixivIconLoadError(name, "Loader was not found");
117
+ }
118
+ return loader.fetch().catch((e) => {
119
+ if (e instanceof PixivIconLoadError) {
120
+ throw e;
121
+ }
122
+ throw new PixivIconLoadError(name, e);
123
+ });
124
+ }
125
+ function resolveIconLoader(name) {
126
+ const registeredLoader = loaders.get(name);
127
+ if (registeredLoader) {
128
+ return registeredLoader;
129
+ }
130
+ if (isKnownIconFile(name)) {
131
+ const charcoalIconFilesLoader = new CharcoalIconFilesLoader(name);
132
+ loaders.set(name, charcoalIconFilesLoader);
133
+ return charcoalIconFilesLoader;
134
+ }
135
+ return null;
136
+ }
137
+
138
+ // src/ssr.ts
139
+ var __SERVER__ = typeof window === "undefined";
140
+ var CAN_USE_DOM = typeof HTMLElement !== "undefined";
141
+ if (__SERVER__ || !CAN_USE_DOM) {
142
+ globalThis.HTMLElement = class {
143
+ };
144
+ }
145
+
146
+ // src/PixivIcon.ts
147
+ import DOMPurify from "dompurify";
148
+ var attributes = ["name", "scale", "unsafe-non-guideline-scale"];
149
+ var ROOT_MARGIN = 50;
150
+ var PixivIcon = class extends HTMLElement {
151
+ static extend(map) {
152
+ warning(!__SERVER__, "Using `PixivIcon.extend()` on server has no effect");
153
+ if (__SERVER__) {
154
+ return;
155
+ }
156
+ Object.entries(map).forEach(([name, filePathOrUrl]) => {
157
+ if (!name.includes("/")) {
158
+ throw new TypeError(
159
+ `${name} is not a valid icon name. "name" must be named like [size]/[Name].`
160
+ );
161
+ }
162
+ addCustomIcon(name, filePathOrUrl);
163
+ });
164
+ }
165
+ static get observedAttributes() {
166
+ return attributes;
167
+ }
168
+ svgContent;
169
+ observer;
170
+ isVisible = false;
171
+ get props() {
172
+ const partial = Object.fromEntries(
173
+ attributes.map((attribute) => [attribute, this.getAttribute(attribute)])
174
+ );
175
+ const name = partial.name;
176
+ if (name === null) {
177
+ throw new TypeError('property "name" is required.');
178
+ }
179
+ if (!name.includes("/")) {
180
+ throw new TypeError(
181
+ `${name} is not a valid icon name. "name" must be named like [size]/[Name].`
182
+ );
183
+ }
184
+ return {
185
+ ...partial,
186
+ name
187
+ };
188
+ }
189
+ get forceResizedSize() {
190
+ if (this.props["unsafe-non-guideline-scale"] === null) {
191
+ return null;
192
+ }
193
+ const [size] = this.props.name.split("/");
194
+ const scale = Number(this.props["unsafe-non-guideline-scale"]);
195
+ switch (size) {
196
+ case "Inline": {
197
+ return 16 * scale;
198
+ }
199
+ default: {
200
+ return Number(size) * scale;
201
+ }
202
+ }
203
+ }
204
+ get scaledSize() {
205
+ const [size] = this.props.name.split("/");
206
+ const scale = Number(this.props.scale ?? "1");
207
+ switch (size) {
208
+ case "Inline": {
209
+ switch (scale) {
210
+ case 2: {
211
+ return 32;
212
+ }
213
+ default: {
214
+ return 16;
215
+ }
216
+ }
217
+ }
218
+ case "24": {
219
+ return Number(size) * scale;
220
+ }
221
+ default: {
222
+ return Number(size);
223
+ }
224
+ }
225
+ }
226
+ constructor() {
227
+ super();
228
+ this.attachShadow({ mode: "open" });
229
+ }
230
+ async connectedCallback() {
231
+ this.render();
232
+ await this.waitUntilVisible();
233
+ this.isVisible = true;
234
+ await this.loadSvg(this.props.name);
235
+ }
236
+ disconnectedCallback() {
237
+ this.observer?.disconnect();
238
+ this.observer = void 0;
239
+ this.isVisible = false;
240
+ }
241
+ attributeChangedCallback(attr, _oldValue, newValue) {
242
+ if (!this.isVisible) {
243
+ return;
244
+ }
245
+ if (attr === "name") {
246
+ void this.loadSvg(newValue);
247
+ return;
248
+ }
249
+ if (this.svgContent !== void 0) {
250
+ this.render();
251
+ return;
252
+ }
253
+ void this.loadSvg(this.props.name);
254
+ }
255
+ render() {
256
+ const size = this.forceResizedSize ?? this.scaledSize;
257
+ const style = DOMPurify.sanitize(
258
+ `<style>
259
+ :host {
260
+ display: inline-flex;
261
+ --size: ${size}px;
262
+ }
263
+
264
+ svg {
265
+ width: var(--size);
266
+ height: var(--size);
267
+ }
268
+ </style>`,
269
+ { ALLOWED_TAGS: ["style"], FORCE_BODY: true }
270
+ );
271
+ const svg = DOMPurify.sanitize(
272
+ this.svgContent !== void 0 ? this.svgContent : `<svg viewBox="0 0 ${size} ${size}"></svg>`,
273
+ { USE_PROFILES: { svg: true, svgFilters: true } }
274
+ );
275
+ this.shadowRoot.innerHTML = style + svg;
276
+ }
277
+ async loadSvg(name) {
278
+ this.svgContent = await getIcon(name);
279
+ this.render();
280
+ }
281
+ waitUntilVisible() {
282
+ return new Promise((resolve) => {
283
+ this.observer = new IntersectionObserver(
284
+ ([first]) => {
285
+ if (first.isIntersecting) {
286
+ this.observer?.disconnect();
287
+ this.observer = void 0;
288
+ resolve();
289
+ }
290
+ },
291
+ { rootMargin: `${ROOT_MARGIN}px` }
292
+ );
293
+ this.observer.observe(this);
294
+ });
295
+ }
296
+ };
297
+ __publicField(PixivIcon, "tagName", "pixiv-icon");
298
+
299
+ // src/index.ts
300
+ if (!__SERVER__) {
301
+ if (!window.customElements.get(PixivIcon.tagName)) {
302
+ window.PixivIcon = PixivIcon;
303
+ window.customElements.define(PixivIcon.tagName, PixivIcon);
304
+ }
305
+ }
306
+ export {
307
+ KNOWN_ICON_FILES,
308
+ PixivIcon,
309
+ PixivIconLoadError
310
+ };
311
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/PixivIcon.ts","../src/charcoalIconFiles.ts","../src/loaders/PixivIconLoadError.ts","../src/loaders/CharcoalIconFilesLoader.ts","../src/loaders/CustomIconLoader.ts","../src/loaders/index.ts","../src/ssr.ts","../src/index.ts"],"sourcesContent":["import type React from 'react'\nimport warning from 'warning'\nimport { KnownIconFile } from './charcoalIconFiles'\nimport { getIcon, addCustomIcon } from './loaders'\nimport { __SERVER__ } from './ssr'\nimport DOMPurify from 'dompurify'\n\nconst attributes = ['name', 'scale', 'unsafe-non-guideline-scale'] as const\n\nconst ROOT_MARGIN = 50\n\nexport interface KnownIconType extends Record<KnownIconFile, unknown> {}\n\nexport interface Props\n extends Omit<\n React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>,\n 'className' | 'css'\n > {\n name: keyof KnownIconType\n scale?: 1 | 2 | 3 | '1' | '2' | '3'\n 'unsafe-non-guideline-scale'?: number | string\n\n // CustomElements は className が使えない。class と書く必要がある\n // https://ja.reactjs.org/docs/web-components.html#using-web-components-in-react\n class?: string\n}\n\ntype ExtendedIconFile = Exclude<keyof KnownIconType, KnownIconFile>\ntype Extended = [ExtendedIconFile] extends [never] // NOTE: ExtendedIconFileがneverならKnownIconTypeは拡張されていない\n ? false\n : true\n\nexport class PixivIcon extends HTMLElement {\n static readonly tagName = 'pixiv-icon'\n\n static extend(\n map: Extended extends true\n ? Record<ExtendedIconFile, string>\n : Record<string, string>\n ) {\n warning(!__SERVER__, 'Using `PixivIcon.extend()` on server has no effect')\n if (__SERVER__) {\n return\n }\n\n Object.entries(map).forEach(([name, filePathOrUrl]) => {\n if (!name.includes('/')) {\n throw new TypeError(\n `${name} is not a valid icon name. \"name\" must be named like [size]/[Name].`\n )\n }\n\n addCustomIcon(name, filePathOrUrl)\n })\n }\n\n static get observedAttributes() {\n return attributes\n }\n\n private svgContent?: string\n private observer?: IntersectionObserver\n private isVisible = false\n\n get props() {\n const partial = Object.fromEntries(\n attributes.map((attribute) => [attribute, this.getAttribute(attribute)])\n ) as Record<(typeof attributes)[number], string | null>\n\n const name = partial.name\n\n if (name === null) {\n throw new TypeError('property \"name\" is required.')\n }\n\n if (!name.includes('/')) {\n throw new TypeError(\n `${name} is not a valid icon name. \"name\" must be named like [size]/[Name].`\n )\n }\n\n return {\n ...partial,\n name,\n }\n }\n\n get forceResizedSize() {\n if (this.props['unsafe-non-guideline-scale'] === null) {\n return null\n }\n\n const [size] = this.props.name.split('/')\n const scale = Number(this.props['unsafe-non-guideline-scale'])\n\n switch (size) {\n case 'Inline': {\n return 16 * scale\n }\n\n default: {\n return Number(size) * scale\n }\n }\n }\n\n get scaledSize() {\n const [size] = this.props.name.split('/')\n\n const scale = Number(this.props.scale ?? '1')\n\n switch (size) {\n case 'Inline': {\n switch (scale) {\n case 2: {\n return 32\n }\n\n default: {\n return 16\n }\n }\n }\n\n case '24': {\n return Number(size) * scale\n }\n\n default: {\n return Number(size)\n }\n }\n }\n\n constructor() {\n super()\n this.attachShadow({ mode: 'open' })\n }\n\n async connectedCallback() {\n this.render()\n await this.waitUntilVisible()\n this.isVisible = true\n await this.loadSvg(this.props.name)\n }\n\n disconnectedCallback() {\n this.observer?.disconnect()\n this.observer = undefined\n this.isVisible = false\n }\n\n attributeChangedCallback(\n attr: string,\n _oldValue: string | null,\n newValue: string\n ) {\n // 非表示の場合はロードしない\n if (!this.isVisible) {\n return\n }\n\n // name が変更された場合必ず再読み込みを試みる\n if (attr === 'name') {\n void this.loadSvg(newValue)\n return\n }\n\n // SVG が読み込み済み && scale などの変更だけならそこだけ反映すればいい\n if (this.svgContent !== undefined) {\n this.render()\n return\n }\n\n // まだ SVG が読み込めてないなら load\n void this.loadSvg(this.props.name)\n }\n\n render() {\n const size = this.forceResizedSize ?? this.scaledSize\n\n const style = DOMPurify.sanitize(\n `<style>\n :host {\n display: inline-flex;\n --size: ${size}px;\n }\n\n svg {\n width: var(--size);\n height: var(--size);\n }\n</style>`,\n { ALLOWED_TAGS: ['style'], FORCE_BODY: true }\n )\n\n const svg = DOMPurify.sanitize(\n this.svgContent !== undefined\n ? this.svgContent\n : `<svg viewBox=\"0 0 ${size} ${size}\"></svg>`,\n { USE_PROFILES: { svg: true, svgFilters: true } }\n )\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.shadowRoot!.innerHTML = style + svg\n }\n\n private async loadSvg(name: string) {\n this.svgContent = await getIcon(name)\n this.render()\n }\n\n private waitUntilVisible() {\n return new Promise<void>((resolve) => {\n this.observer = new IntersectionObserver(\n ([first]) => {\n if (first.isIntersecting) {\n this.observer?.disconnect()\n this.observer = undefined\n resolve()\n }\n },\n { rootMargin: `${ROOT_MARGIN}px` }\n )\n\n this.observer.observe(this)\n })\n }\n}\n","import charcoalIconFiles from '@charcoal-ui/icon-files'\n\nexport default charcoalIconFiles\nexport type KnownIconFile = keyof typeof charcoalIconFiles\nexport const KNOWN_ICON_FILES = Object.keys(\n charcoalIconFiles\n) as KnownIconFile[]\n\nexport function isKnownIconFile(name: string): name is KnownIconFile {\n return name in charcoalIconFiles\n}\n","export class PixivIconLoadError extends Error {\n constructor(name: string, cause: unknown) {\n const message = formatMessage(name, cause)\n\n super(message, { cause })\n this.name = 'PixivIconLoadError'\n Object.setPrototypeOf(this, new.target.prototype)\n }\n}\n\nfunction formatMessage(name: string, cause: unknown) {\n const message = `Failed to fetch <pixiv-icon name=\"${name}\">`\n if (cause == null) {\n return message\n }\n\n if (cause instanceof Error) {\n return `${message}: ${cause.toString()})`\n }\n\n return `${message}: ${JSON.stringify(cause)})`\n}\n","import { PixivIconLoadError } from './PixivIconLoadError'\nimport { Loadable } from './Loadable'\nimport charcoalIconFiles, { KnownIconFile } from '../charcoalIconFiles'\n\n/**\n * `@charcoal-ui/icon-files` に収録されているアイコンを取ってくる\n */\nexport class CharcoalIconFilesLoader implements Loadable {\n private _name: KnownIconFile\n private _resultSvg: string | undefined = undefined\n private _promise: Promise<string> | undefined = undefined\n\n constructor(name: KnownIconFile) {\n this._name = name\n }\n\n get importIconFile() {\n return charcoalIconFiles[this._name]\n }\n\n async fetch(): Promise<string> {\n if (this._resultSvg !== undefined) {\n return this._resultSvg\n }\n\n if (this._promise) {\n return this._promise\n }\n\n this._promise = this.importIconFile()\n .then((svg) => {\n this._resultSvg = svg\n return this._resultSvg\n })\n .catch((e) => {\n throw new PixivIconLoadError(this._name, e)\n })\n .finally(() => {\n this._promise = undefined\n })\n\n return this._promise\n }\n}\n","import { PixivIconLoadError } from './PixivIconLoadError'\nimport { Loadable } from './Loadable'\n\n/**\n * `PixivIcon.extend()` で登録されたカスタムのアイコンを取得する\n */\nexport class CustomIconLoader implements Loadable {\n private _name: string\n private _filePathOrUrl: string\n private _resultSvg: string | undefined = undefined\n private _promise: Promise<string> | undefined = undefined\n\n constructor(name: string, filePathOrUrl: string) {\n this._name = name\n this._filePathOrUrl = filePathOrUrl\n }\n\n async fetch(): Promise<string> {\n if (this._resultSvg !== undefined) {\n return this._resultSvg\n }\n\n if (this._promise) {\n return this._promise\n }\n\n this._promise = fetch(this._filePathOrUrl)\n .then((response) => {\n if (!response.ok) {\n throw new PixivIconLoadError(this._name, 'Response is not ok')\n }\n\n return response.text()\n })\n .then((svg) => {\n this._resultSvg = svg\n return this._resultSvg\n })\n .catch((e) => {\n if (e instanceof PixivIconLoadError) {\n throw e\n }\n throw new PixivIconLoadError(this._name, e)\n })\n .finally(() => {\n this._promise = undefined\n })\n\n return this._promise\n }\n}\n","import { isKnownIconFile } from '../charcoalIconFiles'\nimport { CharcoalIconFilesLoader } from './CharcoalIconFilesLoader'\nimport { CustomIconLoader } from './CustomIconLoader'\nimport { Loadable } from './Loadable'\nimport { PixivIconLoadError } from './PixivIconLoadError'\n\n/**\n * icon をロードするオブジェクトのプール。Loader のインスタンスは作り次第ここに入れる\n *\n * 同じアイコンへの複数回のリクエストが起きないためには、Loader がこの中でユニークでないと行けない\n */\nconst loaders = new Map<string, Loadable>()\n\nexport function addCustomIcon(name: string, filePathOrUrl: string) {\n loaders.set(name, new CustomIconLoader(name, filePathOrUrl))\n}\n\nexport async function getIcon(name: string) {\n const loader = resolveIconLoader(name)\n if (loader == null) {\n throw new PixivIconLoadError(name, 'Loader was not found')\n }\n\n return loader.fetch().catch((e) => {\n if (e instanceof PixivIconLoadError) {\n throw e\n }\n\n throw new PixivIconLoadError(name, e)\n })\n}\n\nfunction resolveIconLoader(name: string) {\n // 登録済み or キャッシュ済みの場合\n // addCustomIcon で登録された CustomIconLoader は常にこっちを通る\n const registeredLoader = loaders.get(name)\n if (registeredLoader) {\n return registeredLoader\n }\n\n // `@charcoal-ui/icon-files` に収録されているアイコンにはこれを返す\n if (isKnownIconFile(name)) {\n const charcoalIconFilesLoader = new CharcoalIconFilesLoader(name)\n\n loaders.set(name, charcoalIconFilesLoader)\n return charcoalIconFilesLoader\n }\n\n // 存在しないアイコンにはこれを返す\n return null\n}\n","export const __SERVER__ = typeof window === 'undefined'\n\nconst CAN_USE_DOM = typeof HTMLElement !== 'undefined'\n\n// Workaround: `extends HTMLELement` の形式でないとbabelのトランスパイルがおかしくなる\nif (__SERVER__ || !CAN_USE_DOM) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n globalThis.HTMLElement = class {} as any\n}\n","import { PixivIcon, Props } from './PixivIcon'\nimport { __SERVER__ } from './ssr'\nexport { PixivIcon, type KnownIconType, type Props } from './PixivIcon'\nexport { KNOWN_ICON_FILES } from './charcoalIconFiles'\nexport { PixivIconLoadError } from './loaders/PixivIconLoadError'\n\ndeclare global {\n interface Window {\n PixivIcon: typeof PixivIcon\n }\n\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace JSX {\n interface IntrinsicElements {\n 'pixiv-icon': Props\n }\n }\n}\n\nif (!__SERVER__) {\n // TODO: HMR対応\n if (!window.customElements.get(PixivIcon.tagName)) {\n window.PixivIcon = PixivIcon\n window.customElements.define(PixivIcon.tagName, PixivIcon)\n }\n}\n"],"mappings":";;;;;;;;AACA,OAAO,aAAa;;;ACDpB,OAAO,uBAAuB;AAE9B,IAAO,4BAAQ;AAER,IAAM,mBAAmB,OAAO;AAAA,EACrC;AACF;AAEO,SAAS,gBAAgB,MAAqC;AACnE,SAAO,QAAQ;AACjB;;;ACVO,IAAM,qBAAN,cAAiC,MAAM;AAAA,EAC5C,YAAY,MAAc,OAAgB;AACxC,UAAM,UAAU,cAAc,MAAM,KAAK;AAEzC,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,WAAO,eAAe,MAAM,WAAW,SAAS;AAAA,EAClD;AACF;AAEA,SAAS,cAAc,MAAc,OAAgB;AACnD,QAAM,UAAU,qCAAqC;AACrD,MAAI,SAAS,MAAM;AACjB,WAAO;AAAA,EACT;AAEA,MAAI,iBAAiB,OAAO;AAC1B,WAAO,GAAG,YAAY,MAAM,SAAS;AAAA,EACvC;AAEA,SAAO,GAAG,YAAY,KAAK,UAAU,KAAK;AAC5C;;;ACdO,IAAM,0BAAN,MAAkD;AAAA,EAC/C;AAAA,EACA,aAAiC;AAAA,EACjC,WAAwC;AAAA,EAEhD,YAAY,MA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K,aAAa,MAAM,QAAQ,IAAI;AACpC,SAAK,OAAO;AAAA,EACd;AAAA,EAEQ,mBAAmB;AACzB,WAAO,IAAI,QAAc,CAAC,YAAY;AACpC,WAAK,WAAW,IAAI;AAAA,QAClB,CAAC,CAAC,KAAK,MAAM;AACX,cAAI,MAAM,gBAAgB;AACxB,iBAAK,UAAU,WAAW;AAC1B,iBAAK,WAAW;AAChB,oBAAQ;AAAA,UACV;AAAA,QACF;AAAA,QACA,EAAE,YAAY,GAAG,gBAAgB;AAAA,MACnC;AAEA,WAAK,SAAS,QAAQ,IAAI;AAAA,IAC5B,CAAC;AAAA,EACH;AACF;AAnME,cADW,WACK,WAAU;;;AOd5B,IAAI,CAAC,YAAY;AAEf,MAAI,CAAC,OAAO,eAAe,IAAI,UAAU,OAAO,GAAG;AACjD,WAAO,YAAY;AACnB,WAAO,eAAe,OAAO,UAAU,SAAS,SAAS;AAAA,EAC3D;AACF;","names":[]}
@@ -1,14 +1,14 @@
1
- import { Loadable } from './Loadable';
2
- import { KnownIconFile } from '../charcoalIconFiles';
3
- /**
4
- * `@charcoal-ui/icon-files` に収録されているアイコンを取ってくる
5
- */
6
- export declare class CharcoalIconFilesLoader implements Loadable {
7
- private _name;
8
- private _resultSvg;
9
- private _promise;
10
- constructor(name: KnownIconFile);
11
- get importIconFile(): (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>);
12
- fetch(): Promise<string>;
13
- }
1
+ import { Loadable } from './Loadable';
2
+ import { KnownIconFile } from '../charcoalIconFiles';
3
+ /**
4
+ * `@charcoal-ui/icon-files` に収録されているアイコンを取ってくる
5
+ */
6
+ export declare class CharcoalIconFilesLoader implements Loadable {
7
+ private _name;
8
+ private _resultSvg;
9
+ private _promise;
10
+ constructor(name: KnownIconFile);
11
+ get importIconFile(): (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>) | (() => Promise<string>);
12
+ fetch(): Promise<string>;
13
+ }
14
14
  //# sourceMappingURL=CharcoalIconFilesLoader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CharcoalIconFilesLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/CharcoalIconFilesLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAA0B,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEvE;;GAEG;AACH,qBAAa,uBAAwB,YAAW,QAAQ;IACtD,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,QAAQ,CAAyC;gBAE7C,IAAI,EAAE,aAAa;IAI/B,IAAI,cAAc,w+MAEjB;IAEK,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;CAuB/B"}
1
+ {"version":3,"file":"CharcoalIconFilesLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/CharcoalIconFilesLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAA0B,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEvE;;GAEG;AACH,qBAAa,uBAAwB,YAAW,QAAQ;IACtD,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,QAAQ,CAAyC;gBAE7C,IAAI,EAAE,aAAa;IAI/B,IAAI,cAAc,sjNAEjB;IAEK,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;CAuB/B"}
@@ -1,13 +1,13 @@
1
- import { Loadable } from './Loadable';
2
- /**
3
- * `PixivIcon.extend()` で登録されたカスタムのアイコンを取得する
4
- */
5
- export declare class CustomIconLoader implements Loadable {
6
- private _name;
7
- private _filePathOrUrl;
8
- private _resultSvg;
9
- private _promise;
10
- constructor(name: string, filePathOrUrl: string);
11
- fetch(): Promise<string>;
12
- }
1
+ import { Loadable } from './Loadable';
2
+ /**
3
+ * `PixivIcon.extend()` で登録されたカスタムのアイコンを取得する
4
+ */
5
+ export declare class CustomIconLoader implements Loadable {
6
+ private _name;
7
+ private _filePathOrUrl;
8
+ private _resultSvg;
9
+ private _promise;
10
+ constructor(name: string, filePathOrUrl: string);
11
+ fetch(): Promise<string>;
12
+ }
13
13
  //# sourceMappingURL=CustomIconLoader.d.ts.map
@@ -1,4 +1,4 @@
1
- export interface Loadable {
2
- fetch(): Promise<string>;
3
- }
1
+ export interface Loadable {
2
+ fetch(): Promise<string>;
3
+ }
4
4
  //# sourceMappingURL=Loadable.d.ts.map
@@ -1,4 +1,4 @@
1
- export declare class PixivIconLoadError extends Error {
2
- constructor(name: string, cause: unknown);
3
- }
1
+ export declare class PixivIconLoadError extends Error {
2
+ constructor(name: string, cause: unknown);
3
+ }
4
4
  //# sourceMappingURL=PixivIconLoadError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PixivIconLoadError.d.ts","sourceRoot":"","sources":["../../src/loaders/PixivIconLoadError.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAQzC"}
1
+ {"version":3,"file":"PixivIconLoadError.d.ts","sourceRoot":"","sources":["../../src/loaders/PixivIconLoadError.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAOzC"}
@@ -1,3 +1,3 @@
1
- export declare function addCustomIcon(name: string, filePathOrUrl: string): void;
2
- export declare function getIcon(name: string): Promise<string>;
1
+ export declare function addCustomIcon(name: string, filePathOrUrl: string): void;
2
+ export declare function getIcon(name: string): Promise<string>;
3
3
  //# sourceMappingURL=index.d.ts.map
package/dist/ssr.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const __SERVER__: boolean;
1
+ export declare const __SERVER__: boolean;
2
2
  //# sourceMappingURL=ssr.d.ts.map
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "name": "@charcoal-ui/icons",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "license": "Apache-2.0",
5
- "type": "module",
6
- "source": "./src/index.ts",
7
- "main": "./dist/index.cjs",
8
- "module": "./dist/index.module.js",
5
+ "main": "./dist/index.cjs.js",
6
+ "module": "./dist/index.esm.js",
9
7
  "exports": {
10
- "require": "./dist/index.cjs",
11
- "default": "./dist/index.modern.js"
8
+ "require": "./dist/index.cjs.js",
9
+ "default": "./dist/index.esm.js"
12
10
  },
13
11
  "types": "./dist/index.d.ts",
14
12
  "sideEffects": true,
15
13
  "scripts": {
16
- "build": "microbundle --compress=false -f modern,esm,cjs --tsconfig tsconfig.build.json",
17
- "typecheck": "tsc --noEmit --project tsconfig.build.json",
18
- "clean": "rimraf dist"
14
+ "build": "run-p --print-label 'build:*'",
15
+ "build:bundle": "FORCE_COLOR=1 tsup",
16
+ "build:dts": "tsc --project tsconfig.build.json --pretty --emitDeclarationOnly",
17
+ "typecheck": "tsc --project tsconfig.build.json --pretty --noEmit",
18
+ "clean": "rimraf dist .tsbuildinfo"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/dompurify": "^2.3.3",
22
22
  "@types/jest": "^27.4.0",
23
23
  "@types/react": "^17.0.38",
24
24
  "@types/warning": "^3.0.0",
25
- "microbundle": "^0.14.2",
26
25
  "react": "^17.0.2",
27
26
  "rimraf": "^3.0.2",
28
27
  "styled-components": "^5.3.3",
29
- "typescript": "^4.5.5"
28
+ "tsup": "^6.5.0",
29
+ "typescript": "^4.9.5"
30
30
  },
31
31
  "dependencies": {
32
- "@charcoal-ui/icon-files": "^2.4.0",
32
+ "@charcoal-ui/icon-files": "^2.6.0",
33
33
  "dompurify": "^2.3.6",
34
34
  "warning": "^4.0.3"
35
35
  },
@@ -46,5 +46,5 @@
46
46
  "url": "https://github.com/pixiv/charcoal.git",
47
47
  "directory": "packages/icons"
48
48
  },
49
- "gitHead": "db58bc1a8e14d5f1ccb6e1e275fa29cfb3ec4972"
49
+ "gitHead": "8579b406b316285a35858512030d2143524ae154"
50
50
  }
package/src/PixivIcon.ts CHANGED
@@ -65,7 +65,7 @@ export class PixivIcon extends HTMLElement {
65
65
  get props() {
66
66
  const partial = Object.fromEntries(
67
67
  attributes.map((attribute) => [attribute, this.getAttribute(attribute)])
68
- ) as Record<typeof attributes[number], string | null>
68
+ ) as Record<(typeof attributes)[number], string | null>
69
69
 
70
70
  const name = partial.name
71
71
 
@@ -2,8 +2,7 @@ export class PixivIconLoadError extends Error {
2
2
  constructor(name: string, cause: unknown) {
3
3
  const message = formatMessage(name, cause)
4
4
 
5
- // TODO: TypeScript 4.6+ になるとここに `{ cause }` が渡せる
6
- super(message)
5
+ super(message, { cause })
7
6
  this.name = 'PixivIconLoadError'
8
7
  Object.setPrototypeOf(this, new.target.prototype)
9
8
  }