amateras 0.5.0 → 0.7.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.
- package/README.md +23 -26
- package/index.ts +1 -0
- package/package.json +32 -27
- package/packages/core/package.json +32 -0
- package/packages/core/src/env.browser.ts +21 -0
- package/packages/core/src/env.node.ts +21 -0
- package/packages/core/src/global.ts +18 -0
- package/packages/core/src/index.ts +96 -0
- package/packages/core/src/lib/assignNodeProperties.ts +11 -0
- package/packages/core/src/lib/assignProperties.ts +57 -0
- package/packages/core/src/lib/chain.ts +17 -0
- package/packages/core/src/lib/dom.ts +20 -0
- package/packages/core/src/main.ts +4 -0
- package/{src → packages/core/src}/node/$Element.ts +25 -47
- package/packages/core/src/node/$EventTarget.ts +48 -0
- package/{src → packages/core/src}/node/$HTMLElement.ts +1 -1
- package/{src → packages/core/src}/node/$Node.ts +64 -73
- package/packages/core/src/node/$Virtual.ts +65 -0
- package/packages/css/package.json +17 -0
- package/{ext/css/src/lib → packages/css/src/ext}/colors/amber.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/blackwhite.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/blue.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/cyan.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/emerald.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/fuchsia.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/gray.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/green.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/indigo.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/lime.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/neutral.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/orange.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/pink.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/purple.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/red.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/rose.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/sky.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/slate.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/stone.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/teal.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/violet.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/yellow.ts +2 -2
- package/{ext/css/src/lib → packages/css/src/ext}/colors/zinc.ts +2 -2
- package/packages/css/src/ext/container.ts +32 -0
- package/packages/css/src/ext/keyframes.ts +54 -0
- package/packages/css/src/ext/media.ts +32 -0
- package/packages/css/src/ext/property.ts +48 -0
- package/packages/css/src/ext/variable.ts +51 -0
- package/{ext → packages}/css/src/index.ts +107 -183
- package/{ext → packages}/css/src/lib/colorAssign.ts +1 -1
- package/packages/css/src/lib/utils.ts +11 -0
- package/{ext → packages}/css/src/structure/$CSSContainerRule.ts +1 -1
- package/{ext → packages}/css/src/structure/$CSSKeyframesRule.ts +0 -1
- package/{ext → packages}/css/src/structure/$CSSMediaRule.ts +1 -1
- package/packages/css/src/structure/$CSSProperty.ts +19 -0
- package/{ext → packages}/css/src/structure/$CSSRule.ts +1 -1
- package/{ext → packages}/css/src/structure/$CSSStyleRule.ts +1 -1
- package/packages/css/src/structure/$CSSVariable.ts +30 -0
- package/packages/dom/package.json +20 -0
- package/packages/dom/src/lib/HTMLElementMap.ts +213 -0
- package/packages/dom/src/lib/assignAttributes.ts +16 -0
- package/packages/dom/src/structure/CSS.ts +7 -0
- package/packages/dom/src/structure/CSSStyleSheet.ts +10 -0
- package/packages/dom/src/structure/DOMTokenList.ts +19 -0
- package/packages/dom/src/structure/Document.ts +36 -0
- package/packages/dom/src/structure/Element.ts +106 -0
- package/packages/dom/src/structure/HTMLElement.ts +34 -0
- package/packages/dom/src/structure/History.ts +11 -0
- package/packages/dom/src/structure/Location.ts +9 -0
- package/packages/dom/src/structure/Node.ts +51 -0
- package/packages/dom/src/structure/NodeList.ts +10 -0
- package/packages/dom/src/structure/Storage.ts +8 -0
- package/packages/dom/src/structure/Text.ts +20 -0
- package/packages/dom/src/structure/Window.ts +14 -0
- package/packages/dom/src/structure/html/HTMLAbbrElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLAddressElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLAnchorElement.ts +25 -0
- package/packages/dom/src/structure/html/HTMLAreaElement.ts +26 -0
- package/packages/dom/src/structure/html/HTMLArticleElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLAsideElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLAudioElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLBDIElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLBDOElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLBElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLBRElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLBaseElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLBodyElement.ts +22 -0
- package/packages/dom/src/structure/html/HTMLButtonElement.ts +26 -0
- package/packages/dom/src/structure/html/HTMLCanvasElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLCiteElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLCodeElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLDDElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLDFNElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLDListElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLDTElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLDataElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLDataListElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLDetailsElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLDialogElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLDivElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLEMElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLEmbedElement.ts +20 -0
- package/packages/dom/src/structure/html/HTMLFieldSetElement.ts +19 -0
- package/packages/dom/src/structure/html/HTMLFigCaptionElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLFigureElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLFooterElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLFormElement.ts +24 -0
- package/packages/dom/src/structure/html/HTMLHGroupElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLHRElement.ts +21 -0
- package/packages/dom/src/structure/html/HTMLHeadElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLHeaderElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLHeadingElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLHtmlElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLIElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLIFrameElement.ts +31 -0
- package/packages/dom/src/structure/html/HTMLImageElement.ts +38 -0
- package/packages/dom/src/structure/html/HTMLInputElement.ts +55 -0
- package/packages/dom/src/structure/html/HTMLKBDElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLLIElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLLabelElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLLegendElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLLinkElement.ts +31 -0
- package/packages/dom/src/structure/html/HTMLMainElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLMapElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLMarkElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLMediaElement.ts +48 -0
- package/packages/dom/src/structure/html/HTMLMenuElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLMetaElement.ts +22 -0
- package/packages/dom/src/structure/html/HTMLMeterElement.ts +23 -0
- package/packages/dom/src/structure/html/HTMLModElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLNavElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLNoscriptElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLOListElement.ts +20 -0
- package/packages/dom/src/structure/html/HTMLObjectElement.ts +34 -0
- package/packages/dom/src/structure/html/HTMLOptGroupElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLOptionElement.ts +20 -0
- package/packages/dom/src/structure/html/HTMLOutputElement.ts +20 -0
- package/packages/dom/src/structure/html/HTMLParagraphElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLPictureElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLPreElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLProgressElement.ts +19 -0
- package/packages/dom/src/structure/html/HTMLQuoteElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLRPElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLRTElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLRubyElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLSElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLSampElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLScriptElement.ts +27 -0
- package/packages/dom/src/structure/html/HTMLSectionElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLSelectElement.ts +27 -0
- package/packages/dom/src/structure/html/HTMLSlotElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLSmallElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLSourceElement.ts +21 -0
- package/packages/dom/src/structure/html/HTMLSpanElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLStrongElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLStyleElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLSubElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLSummaryElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLSupElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLTableCaptionElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLTableCellElement.ts +31 -0
- package/packages/dom/src/structure/html/HTMLTableColElement.ts +23 -0
- package/packages/dom/src/structure/html/HTMLTableElement.ts +26 -0
- package/packages/dom/src/structure/html/HTMLTableRowElement.ts +23 -0
- package/packages/dom/src/structure/html/HTMLTableSectionElement.ts +20 -0
- package/packages/dom/src/structure/html/HTMLTemplateElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLTextAreaElement.ts +33 -0
- package/packages/dom/src/structure/html/HTMLTimeElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLTitleElement.ts +17 -0
- package/packages/dom/src/structure/html/HTMLTrackElement.ts +21 -0
- package/packages/dom/src/structure/html/HTMLUElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLUListElement.ts +18 -0
- package/packages/dom/src/structure/html/HTMLVarElement.ts +16 -0
- package/packages/dom/src/structure/html/HTMLVideoElement.ts +22 -0
- package/packages/dom/src/structure/html/HTMLWBRElement.ts +16 -0
- package/packages/html/package.json +18 -0
- package/{ext/html/html.ts → packages/html/src/index.ts} +1 -1
- package/{ext/html → packages/html/src}/node/$Anchor.ts +4 -4
- package/packages/html/src/node/$Canvas.ts +38 -0
- package/{ext/html → packages/html/src}/node/$Dialog.ts +4 -4
- package/{ext/html → packages/html/src}/node/$Form.ts +4 -4
- package/{ext/html → packages/html/src}/node/$Image.ts +4 -4
- package/{ext/html → packages/html/src}/node/$Input.ts +4 -4
- package/{ext/html → packages/html/src}/node/$Label.ts +4 -4
- package/{ext/html → packages/html/src}/node/$Media.ts +4 -4
- package/{ext/html → packages/html/src}/node/$OptGroup.ts +4 -4
- package/{ext/html → packages/html/src}/node/$Option.ts +4 -4
- package/{ext/html → packages/html/src}/node/$Select.ts +4 -4
- package/{ext/html → packages/html/src}/node/$TextArea.ts +4 -4
- package/{ext → packages}/i18n/README.md +20 -0
- package/packages/i18n/package.json +19 -0
- package/packages/i18n/src/index.ts +140 -0
- package/{ext → packages}/i18n/src/structure/I18n.ts +12 -8
- package/{ext → packages}/i18n/src/structure/I18nDictionary.ts +1 -1
- package/packages/i18n/src/structure/I18nTranslation.ts +41 -0
- package/packages/idb/package.json +19 -0
- package/{ext → packages}/idb/src/index.ts +2 -2
- package/{ext → packages}/idb/src/lib/$IDBRequest.ts +1 -1
- package/{ext → packages}/idb/src/structure/$IDB.ts +1 -1
- package/{ext → packages}/idb/src/structure/$IDBCursor.ts +1 -1
- package/{ext → packages}/idb/src/structure/$IDBIndex.ts +1 -1
- package/{ext → packages}/idb/src/structure/$IDBStore.ts +1 -1
- package/{ext → packages}/idb/src/structure/$IDBStoreBase.ts +1 -1
- package/{ext → packages}/idb/src/structure/$IDBTransaction.ts +1 -1
- package/{ext → packages}/idb/src/structure/builder/$IDBBuilder.ts +9 -10
- package/{ext → packages}/idb/src/structure/builder/$IDBStoreBuilder.ts +1 -1
- package/packages/markdown/README.md +53 -0
- package/packages/markdown/package.json +19 -0
- package/packages/markdown/src/index.ts +3 -0
- package/packages/markdown/src/lib/type.ts +26 -0
- package/packages/markdown/src/lib/util.ts +21 -0
- package/packages/markdown/src/structure/Markdown.ts +54 -0
- package/packages/markdown/src/structure/MarkdownLexer.ts +111 -0
- package/packages/markdown/src/structure/MarkdownParser.ts +34 -0
- package/packages/markdown/src/syntax/alert.ts +46 -0
- package/packages/markdown/src/syntax/blockquote.ts +35 -0
- package/packages/markdown/src/syntax/bold.ts +11 -0
- package/packages/markdown/src/syntax/code.ts +11 -0
- package/packages/markdown/src/syntax/codeblock.ts +44 -0
- package/packages/markdown/src/syntax/heading.ts +14 -0
- package/packages/markdown/src/syntax/horizontalRule.ts +11 -0
- package/packages/markdown/src/syntax/image.ts +23 -0
- package/packages/markdown/src/syntax/italic.ts +11 -0
- package/packages/markdown/src/syntax/link.ts +46 -0
- package/packages/markdown/src/syntax/list.ts +121 -0
- package/packages/markdown/src/syntax/table.ts +67 -0
- package/packages/markdown/src/syntax/text.ts +19 -0
- package/packages/router/README.md +175 -0
- package/packages/router/package.json +19 -0
- package/packages/router/src/index.ts +68 -0
- package/packages/router/src/node/Page.ts +38 -0
- package/packages/router/src/node/Router.ts +212 -0
- package/{ext/router → packages/router/src}/node/RouterAnchor.ts +13 -2
- package/packages/router/src/structure/PageBuilder.ts +24 -0
- package/packages/router/src/structure/Route.ts +105 -0
- package/packages/signal/README.md +93 -0
- package/packages/signal/package.json +18 -0
- package/packages/signal/src/index.ts +221 -0
- package/{src → packages/signal/src}/structure/Signal.ts +6 -10
- package/packages/ssr/package.json +19 -0
- package/packages/ssr/src/index.ts +38 -0
- package/packages/ui/lib/VirtualScroll.ts +25 -0
- package/packages/ui/node/Accordian.ts +97 -0
- package/packages/ui/node/Carousel.ts +20 -0
- package/packages/ui/node/Form.ts +54 -0
- package/packages/ui/node/Grid.ts +0 -0
- package/packages/ui/node/Modal.ts +45 -0
- package/packages/ui/node/Table.ts +43 -0
- package/packages/ui/node/Tabs.ts +129 -0
- package/packages/ui/node/Toast.ts +16 -0
- package/packages/ui/node/Waterfall.ts +94 -0
- package/packages/ui/package.json +21 -0
- package/packages/utils/package.json +17 -0
- package/{src → packages/utils/src}/global.ts +9 -15
- package/packages/utils/src/index.ts +90 -0
- package/tsconfig.json +1 -1
- package/ext/css/package.json +0 -9
- package/ext/css/src/structure/$CSSVariable.ts +0 -12
- package/ext/html/node/$Canvas.ts +0 -16
- package/ext/i18n/package.json +0 -10
- package/ext/i18n/src/index.ts +0 -54
- package/ext/i18n/src/node/I18nText.ts +0 -35
- package/ext/idb/package.json +0 -13
- package/ext/markdown/index.ts +0 -121
- package/ext/markdown/package.json +0 -8
- package/ext/router/README.md +0 -81
- package/ext/router/index.ts +0 -73
- package/ext/router/node/Page.ts +0 -27
- package/ext/router/node/Route.ts +0 -54
- package/ext/router/node/Router.ts +0 -149
- package/ext/ssr/env.ts +0 -61
- package/ext/ssr/index.ts +0 -49
- package/ext/ssr/package.json +0 -10
- package/src/core.ts +0 -114
- package/src/index.ts +0 -3
- package/src/lib/assign.ts +0 -38
- package/src/lib/assignHelper.ts +0 -18
- package/src/lib/chain.ts +0 -13
- package/src/lib/debounce.ts +0 -7
- package/src/lib/env.ts +0 -2
- package/src/lib/native.ts +0 -40
- package/src/lib/randomId.ts +0 -9
- package/src/lib/sleep.ts +0 -3
- package/src/lib/toArray.ts +0 -9
- package/src/lib/trycatch.ts +0 -17
- package/src/node.ts +0 -10
- /package/{ext → packages}/css/README.md +0 -0
- /package/{ext/css/src/lib → packages/css/src/ext}/colors.ts +0 -0
- /package/{ext → packages}/css/src/structure/$CSSDeclaration.ts +0 -0
- /package/{ext → packages}/idb/README.md +0 -0
- /package/{ext → packages}/idb/src/core.ts +0 -0
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { _document } from "#env";
|
|
2
|
+
import { _Array_from, _instanceof, _JSON_stringify, _null, _Promise, forEach, isFunction, isNull, isUndefined, toArray } from "@amateras/utils";
|
|
3
|
+
import { $EventTarget } from "./$EventTarget";
|
|
4
|
+
|
|
5
|
+
export class $Node<EvMap = {}> extends $EventTarget<EvMap> {
|
|
6
|
+
declare node: Node & ChildNode & ParentNode;
|
|
7
|
+
static processors = new Set<$NodeContentProcessor>();
|
|
8
|
+
static setters = new Set<$NodeSetterHandler>();
|
|
9
9
|
constructor(node: Node & ChildNode) {
|
|
10
|
-
|
|
11
|
-
//@ts-expect-error
|
|
12
|
-
this.node.$ = this;
|
|
10
|
+
super(node);
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
content(children: $NodeContentResolver<this>) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.insert(children);
|
|
19
|
-
})
|
|
14
|
+
forEach(_Array_from(this.childNodes), node => node.remove());
|
|
15
|
+
return this.insert(children);
|
|
20
16
|
}
|
|
21
17
|
|
|
22
18
|
insert(resolver: $NodeContentResolver<this>, position = -1) {
|
|
23
19
|
// process nodes
|
|
24
|
-
forEach(toArray(resolver), resolve_child => forEach($Node.process(this, resolve_child), $node =>
|
|
20
|
+
forEach(toArray(resolver), resolve_child => forEach($Node.process(this, resolve_child), $node => {
|
|
21
|
+
$Node.append(this, $node, position);
|
|
22
|
+
if (position >= 0) position++;
|
|
23
|
+
}));
|
|
25
24
|
return this;
|
|
26
25
|
}
|
|
27
26
|
|
|
@@ -58,50 +57,19 @@ export class $Node {
|
|
|
58
57
|
return _instanceof(this, instance) ? this : null;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
on(type: string, listener: any, options?: boolean | AddEventListenerOptions) {
|
|
62
|
-
return this.addEventListener(type, listener, options);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
off(type: string, listener: any, options?: boolean | EventListenerOptions) {
|
|
66
|
-
return this.removeEventListener(type, listener, options);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
once(type: string, listener: any, options?: boolean | AddEventListenerOptions) {
|
|
70
|
-
return this.on(type, listener, { once: true, ...(isBoolean(options) ? {capture: options} : options ?? {}) })
|
|
71
|
-
}
|
|
72
|
-
|
|
73
60
|
static process<T extends $Node>($node: T, content: $NodeContentResolver<any>): Array<$Node | undefined | null> {
|
|
61
|
+
for (const processor of this.processors) {
|
|
62
|
+
const result = processor($node, content);
|
|
63
|
+
if (result) content = result;
|
|
64
|
+
}
|
|
74
65
|
if (isUndefined(content) || isNull(content) || _instanceof(content, $Node)) return [content];
|
|
75
66
|
// is Promise
|
|
76
67
|
if (_instanceof(content, _Promise)) return [$('async').await(content, ($async, $child) => $async.replace($child as any))];
|
|
77
68
|
// is SignalFunction or ContentHandler
|
|
78
69
|
if (isFunction(content)) {
|
|
79
|
-
const
|
|
80
|
-
if (_instanceof(
|
|
81
|
-
|
|
82
|
-
if (_instanceof(resolver, $Node)) {
|
|
83
|
-
// handler signal $Node result
|
|
84
|
-
let node = resolver;
|
|
85
|
-
const set = (value: any) => {
|
|
86
|
-
node.replace(value);
|
|
87
|
-
node = value;
|
|
88
|
-
}
|
|
89
|
-
signal.subscribe(set);
|
|
90
|
-
return [resolver];
|
|
91
|
-
} else {
|
|
92
|
-
// handler signal other type result
|
|
93
|
-
const $text = _document ? new $Text() : $('signal').attr({ type: typeof signal.value() });
|
|
94
|
-
const set = (value: any) => $text.textContent(isObject(value) ? _JSON_stringify(value) : value);
|
|
95
|
-
if (_instanceof($text, $Text)) $text.signals.add(signal);
|
|
96
|
-
signal.subscribe(set);
|
|
97
|
-
set(resolver);
|
|
98
|
-
return [$text];
|
|
99
|
-
}
|
|
100
|
-
} else {
|
|
101
|
-
const _content = content($node) as $NodeContentResolver<$Node>;
|
|
102
|
-
if (_instanceof(_content, _Promise)) return this.process($node, _content as any);
|
|
103
|
-
else return toArray(_content).map(content => this.process($node, content)).flat();
|
|
104
|
-
}
|
|
70
|
+
const _content = content($node) as $NodeContentResolver<$Node>;
|
|
71
|
+
if (_instanceof(_content, _Promise)) return this.process($node, _content as any);
|
|
72
|
+
else return toArray(_content).map(content => this.process($node, content)).flat();
|
|
105
73
|
}
|
|
106
74
|
// is nested array
|
|
107
75
|
if (_instanceof(content, Array)) return content.map(c => this.process($node, c)).flat();
|
|
@@ -122,17 +90,18 @@ export class $Node {
|
|
|
122
90
|
}
|
|
123
91
|
|
|
124
92
|
export class $Text extends $Node {
|
|
125
|
-
signals = new Set<Signal<any>>();
|
|
126
93
|
constructor(textContent?: string) {
|
|
127
94
|
super(new Text(textContent));
|
|
128
95
|
}
|
|
129
96
|
}
|
|
130
97
|
|
|
98
|
+
export type $NodeSetterHandler = (value: any, set: (value: any) => void) => any;
|
|
99
|
+
export type $NodeContentProcessor = <N extends $Node>($node: N, content: $NodeContentResolver<N>) => $NodeContentResolver<N>;
|
|
131
100
|
export type $NodeContentHandler<T extends $Node> = ($node: T) => OrPromise<$NodeContentResolver<T>>;
|
|
132
|
-
export type $NodeContentTypes = $Node | string | number | boolean |
|
|
101
|
+
export type $NodeContentTypes = $Node | string | number | boolean | $.$NodeContentTypeExtends | null | undefined;
|
|
133
102
|
export type $NodeContentResolver<T extends $Node> = OrPromise<$NodeContentTypes | $NodeContentHandler<T> | $NodeContentResolver<T>[]>;
|
|
134
103
|
|
|
135
|
-
export interface $Node {
|
|
104
|
+
export interface $Node<EvMap = {}> extends $EventTarget<EvMap> {
|
|
136
105
|
/** {@link Node.baseURI} */
|
|
137
106
|
readonly baseURI: string;
|
|
138
107
|
/** {@link Node.childNodes} */
|
|
@@ -157,13 +126,21 @@ export interface $Node {
|
|
|
157
126
|
readonly parentNode?: ParentNode | null;
|
|
158
127
|
/** {@link Node.previousSibling} */
|
|
159
128
|
readonly previousSibling?: ChildNode | null;
|
|
129
|
+
/** {@link ParentNode.childElementCount} */
|
|
130
|
+
readonly childElementCount: number;
|
|
131
|
+
/** {@link ParentNode.children} */
|
|
132
|
+
readonly children: HTMLCollection;
|
|
133
|
+
/** {@link ParentNode.firstElementChild} */
|
|
134
|
+
readonly firstElementChild: Element | null;
|
|
135
|
+
/** {@link ParentNode.lastElementChild} */
|
|
136
|
+
readonly lastElementChild: Element | null;
|
|
160
137
|
|
|
161
138
|
/** {@link Node.appendChild} */
|
|
162
139
|
appendChild<T extends Node>(node: T): T;
|
|
163
140
|
/** {@link Node.cloneNode} */
|
|
164
141
|
cloneNode(subtree?: boolean): Node;
|
|
165
142
|
/** {@link Node.compareDocumentPosition} */
|
|
166
|
-
compareDocumentPosition(other: Node): number;
|
|
143
|
+
compareDocumentPosition(other: $EventTarget | Node): number;
|
|
167
144
|
/** {@link Node.getRootNode} */
|
|
168
145
|
getRootNode(options?: GetRootNodeOptions): Node;
|
|
169
146
|
/** {@link Node.hasChildNodes} */
|
|
@@ -173,9 +150,9 @@ export interface $Node {
|
|
|
173
150
|
/** {@link Node.isDefaultNamespace} */
|
|
174
151
|
isDefaultNamespace(namespace: string | null): boolean;
|
|
175
152
|
/** {@link Node.isEqualNode} */
|
|
176
|
-
isEqualNode(otherNode: Node | null): boolean;
|
|
153
|
+
isEqualNode(otherNode: $EventTarget | Node | null): boolean;
|
|
177
154
|
/** {@link Node.isSameNode} */
|
|
178
|
-
isSameNode(otherNode: Node | null): boolean;
|
|
155
|
+
isSameNode(otherNode: $EventTarget | Node | null): boolean;
|
|
179
156
|
/** {@link Node.lookupNamespaceURI} */
|
|
180
157
|
lookupNamespaceURI(prefix: string | null): string | null;
|
|
181
158
|
/** {@link Node.lookupPrefix} */
|
|
@@ -186,20 +163,34 @@ export interface $Node {
|
|
|
186
163
|
removeChild<T extends Node>(child: T): T;
|
|
187
164
|
/** {@link Node.replaceChild} */
|
|
188
165
|
replaceChild<T extends Node>(node: Node, child: T): T;
|
|
189
|
-
/** {@link Node.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
166
|
+
/** {@link Node.contains} */
|
|
167
|
+
contains(other: $EventTarget | EventTarget | null | undefined): boolean;
|
|
168
|
+
|
|
169
|
+
/** {@link ChildNode.after} */
|
|
170
|
+
after(...nodes: ($EventTarget | Node | string)[]): this;
|
|
171
|
+
/** {@link ChildNode.before} */
|
|
172
|
+
before(...nodes: ($EventTarget | Node | string)[]): this;
|
|
173
|
+
/** {@link ChildNode.remove} */
|
|
194
174
|
remove(): this;
|
|
195
|
-
/** {@link
|
|
196
|
-
replaceWith(...nodes: (Node | string)[]): this;
|
|
197
|
-
/** {@link
|
|
198
|
-
|
|
199
|
-
/** {@link
|
|
200
|
-
|
|
201
|
-
/** {@link
|
|
202
|
-
|
|
175
|
+
/** {@link ChildNode.replaceWith} */
|
|
176
|
+
replaceWith(...nodes: ($EventTarget | Node | string)[]): this;
|
|
177
|
+
/** {@link ParentNode.append} */
|
|
178
|
+
append(...nodes: ($EventTarget | Node | string)[]): this;
|
|
179
|
+
/** {@link ParentNode.prepend} */
|
|
180
|
+
prepend(...nodes: ($EventTarget | Node | string)[]): this;
|
|
181
|
+
/** {@link ParentNode.querySelector} */
|
|
182
|
+
querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
|
|
183
|
+
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
|
|
184
|
+
querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
|
|
185
|
+
querySelector<E extends Element = Element>(selectors: string): E | null;
|
|
186
|
+
/** {@link ParentNode.querySelectorAll} */
|
|
187
|
+
querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
|
|
188
|
+
querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
|
|
189
|
+
querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
|
|
190
|
+
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
191
|
+
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
192
|
+
/** {@link ParentNode.replaceChildren} */
|
|
193
|
+
replaceChildren(...nodes: ($EventTarget | Node | string)[]): this;
|
|
203
194
|
|
|
204
195
|
/** {@link Node.nodeValue} */
|
|
205
196
|
nodeValue(nodeValue: $Parameter<string | null>): this;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { chain } from "#lib/chain";
|
|
2
|
+
import { forEach, _Array_from, _instanceof, _null, toArray } from "@amateras/utils";
|
|
3
|
+
import { $HTMLElement } from "#node/$HTMLElement";
|
|
4
|
+
import { $Node, type $NodeContentResolver } from "#node/$Node";
|
|
5
|
+
|
|
6
|
+
export class $Virtual<Ele extends HTMLElement = HTMLElement, EvMap = HTMLElementEventMap> extends $HTMLElement<Ele, EvMap> {
|
|
7
|
+
nodes = new Set<$Node>();
|
|
8
|
+
hiddenNodes = new Set<$Node>();
|
|
9
|
+
constructor(resolver: string | Ele) {
|
|
10
|
+
super(resolver);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
content(children: $NodeContentResolver<this>) {
|
|
14
|
+
return chain(this, _null, _null, children, children => {
|
|
15
|
+
this.nodes.clear();
|
|
16
|
+
forEach(this.childNodes, node => node.remove());
|
|
17
|
+
this.insert(children);
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
insert(resolver: $NodeContentResolver<this>, position = -1) {
|
|
22
|
+
// process nodes
|
|
23
|
+
forEach(toArray(resolver), resolve_child => {
|
|
24
|
+
forEach($Node.process(this, resolve_child), $node => {
|
|
25
|
+
$Virtual.append(this, $node, position)
|
|
26
|
+
if (position >= 0) position++;
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
hide($node?: $Node | null) {
|
|
33
|
+
if ($node && this.nodes.has($node)) this.hiddenNodes.add($node);
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
show($node?: $Node | null) {
|
|
38
|
+
if ($node) this.hiddenNodes.delete($node);
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
render() {
|
|
43
|
+
// remove hidden node
|
|
44
|
+
forEach(this.childNodes, node => this.hiddenNodes.has($(node)) && node.remove());
|
|
45
|
+
// get array of visible node
|
|
46
|
+
const visibleNodes = _Array_from(this.nodes).filter($node => !this.hiddenNodes.has($node))
|
|
47
|
+
// add visible node with position
|
|
48
|
+
forEach(visibleNodes, ($node, i) => {
|
|
49
|
+
if (
|
|
50
|
+
!$node.inDOM() // node is not in dom tree
|
|
51
|
+
&& $(this.childNodes).at(i) !== $node // node not matched at position
|
|
52
|
+
) $Node.append(this, $node, i);
|
|
53
|
+
})
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static append($node: $Virtual, child: $Node | undefined | null, position: number) {
|
|
58
|
+
if (child) {
|
|
59
|
+
const childList = _Array_from($node.nodes);
|
|
60
|
+
if (!childList.at(position)) childList.push(child);
|
|
61
|
+
else childList.splice(position >= 0 ? position : childList.length + 1 + position, 0, child);
|
|
62
|
+
$node.nodes = new Set(childList);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amateras/css",
|
|
3
|
+
"peerDependencies": {
|
|
4
|
+
"@amateras/core": "workspace:*",
|
|
5
|
+
"@amateras/utils": "workspace:*"
|
|
6
|
+
},
|
|
7
|
+
"imports": {
|
|
8
|
+
"#structure/*": "./src/structure/*.ts",
|
|
9
|
+
"#lib/*": "./src/lib/*.ts",
|
|
10
|
+
"#node/*": "./src/node/*.ts"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
"./structure/*": "./src/structure/*.ts",
|
|
14
|
+
"./lib/*": "./src/lib/*.ts",
|
|
15
|
+
"./node/*": "./src/node/*.ts"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _amber = {
|
|
4
4
|
50: '#fffbeb',
|
|
@@ -16,7 +16,7 @@ const _amber = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('amber', _amber);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const amber: typeof _amber;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
colorAssign('black', '#000000');
|
|
4
4
|
colorAssign('white', '#ffffff');
|
|
5
5
|
|
|
6
|
-
declare module 'amateras/core' {
|
|
6
|
+
declare module '@amateras/core' {
|
|
7
7
|
export namespace $ {
|
|
8
8
|
export namespace color {
|
|
9
9
|
export const black: '#000000';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _blue = {
|
|
4
4
|
50: '#eff6ff',
|
|
@@ -16,7 +16,7 @@ const _blue = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('blue', _blue);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const blue: typeof _blue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _cyan = {
|
|
4
4
|
50: '#ecfeff',
|
|
@@ -16,7 +16,7 @@ const _cyan = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('cyan', _cyan);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const cyan: typeof _cyan;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _emerald = {
|
|
4
4
|
50: '#ecfdf5',
|
|
@@ -16,7 +16,7 @@ const _emerald = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('emerald', _emerald);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const emerald: typeof _emerald;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _fuchsia = {
|
|
4
4
|
50: '#fdf4ff',
|
|
@@ -16,7 +16,7 @@ const _fuchsia = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('fuchsia', _fuchsia);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const fuchsia: typeof _fuchsia;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _gray = {
|
|
4
4
|
50: '#f9fafb',
|
|
@@ -16,7 +16,7 @@ const _gray = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('gray', _gray);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const gray: typeof _gray;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _green = {
|
|
4
4
|
50: '#f0fdf4',
|
|
@@ -16,7 +16,7 @@ const _green = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('green', _green);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const green: typeof _green;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _indigo = {
|
|
4
4
|
50: '#eef2ff',
|
|
@@ -16,7 +16,7 @@ const _indigo = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('indigo', _indigo);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const indigo: typeof _indigo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _lime = {
|
|
4
4
|
50: '#f7fee7',
|
|
@@ -16,7 +16,7 @@ const _lime = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('lime', _lime);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const lime: typeof _lime;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _neutral = {
|
|
4
4
|
50: '#fafafa',
|
|
@@ -16,7 +16,7 @@ const _neutral = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('neutral', _neutral);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const neutral: typeof _neutral;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _orange = {
|
|
4
4
|
50: '#fff7ed',
|
|
@@ -16,7 +16,7 @@ const _orange = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('orange', _orange);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const orange: typeof _orange;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _pink = {
|
|
4
4
|
50: '#fdf2f8',
|
|
@@ -16,7 +16,7 @@ const _pink = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('pink', _pink);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const pink: typeof _pink;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _purple = {
|
|
4
4
|
50: '#faf5ff',
|
|
@@ -16,7 +16,7 @@ const _purple = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('purple', _purple);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const purple: typeof _purple;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _red = {
|
|
4
4
|
50: '#fef2f2',
|
|
@@ -16,7 +16,7 @@ const _red = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('red', _red);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const red: typeof _red;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _rose = {
|
|
4
4
|
50: '#fff1f2',
|
|
@@ -16,7 +16,7 @@ const _rose = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('rose', _rose);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const rose: typeof _rose;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _sky = {
|
|
4
4
|
50: '#f0f9ff',
|
|
@@ -16,7 +16,7 @@ const _sky = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('sky', _sky);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const sky: typeof _sky;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _slate = {
|
|
4
4
|
50: '#f8fafc',
|
|
@@ -16,7 +16,7 @@ const _slate = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('slate', _slate);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const slate: typeof _slate;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _stone = {
|
|
4
4
|
50: '#fafaf9',
|
|
@@ -16,7 +16,7 @@ const _stone = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('stone', _stone);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const stone: typeof _stone;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _teal = {
|
|
4
4
|
50: '#f0fdfa',
|
|
@@ -16,7 +16,7 @@ const _teal = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('teal', _teal);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const teal: typeof _teal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _violet = {
|
|
4
4
|
50: '#f5f3ff',
|
|
@@ -16,7 +16,7 @@ const _violet = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('violet', _violet);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const violet: typeof _violet;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _yellow = {
|
|
4
4
|
50: '#fefce8',
|
|
@@ -16,7 +16,7 @@ const _yellow = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('yellow', _yellow);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const yellow: typeof _yellow;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorAssign } from "
|
|
1
|
+
import { colorAssign } from "../../lib/colorAssign";
|
|
2
2
|
|
|
3
3
|
const _zinc = {
|
|
4
4
|
50: '#fafafa',
|
|
@@ -16,7 +16,7 @@ const _zinc = {
|
|
|
16
16
|
|
|
17
17
|
colorAssign('zinc', _zinc);
|
|
18
18
|
|
|
19
|
-
declare module 'amateras/core' {
|
|
19
|
+
declare module '@amateras/core' {
|
|
20
20
|
export namespace $ {
|
|
21
21
|
export namespace color {
|
|
22
22
|
export const zinc: typeof _zinc;
|