amateras 0.6.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/index.ts +1 -0
- package/package.json +32 -30
- 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/{src/core.ts → packages/core/src/index.ts} +42 -30
- package/{src → packages/core/src}/lib/assignProperties.ts +1 -1
- 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 +22 -10
- package/{src → packages/core/src}/node/$EventTarget.ts +13 -10
- package/{src → packages/core/src}/node/$HTMLElement.ts +1 -1
- package/{src → packages/core/src}/node/$Node.ts +7 -11
- package/{src → packages/core/src}/node/$Virtual.ts +5 -5
- 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 +3 -3
- package/packages/html/src/node/$Canvas.ts +38 -0
- package/{ext/html → packages/html/src}/node/$Dialog.ts +3 -3
- package/{ext/html → packages/html/src}/node/$Form.ts +3 -3
- package/{ext/html → packages/html/src}/node/$Image.ts +3 -3
- package/{ext/html → packages/html/src}/node/$Input.ts +3 -3
- package/{ext/html → packages/html/src}/node/$Label.ts +3 -3
- package/{ext/html → packages/html/src}/node/$Media.ts +3 -3
- package/{ext/html → packages/html/src}/node/$OptGroup.ts +3 -3
- package/{ext/html → packages/html/src}/node/$Option.ts +3 -3
- package/{ext/html → packages/html/src}/node/$Select.ts +3 -3
- package/{ext/html → packages/html/src}/node/$TextArea.ts +3 -3
- package/packages/i18n/package.json +19 -0
- package/{ext → packages}/i18n/src/index.ts +6 -14
- package/{ext → packages}/i18n/src/structure/I18n.ts +2 -2
- package/{ext → packages}/i18n/src/structure/I18nDictionary.ts +1 -1
- package/{ext → packages}/i18n/src/structure/I18nTranslation.ts +10 -4
- 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 +1 -2
- package/{ext → packages}/idb/src/structure/builder/$IDBStoreBuilder.ts +1 -1
- package/packages/markdown/package.json +19 -0
- package/{ext → packages}/markdown/src/lib/util.ts +1 -1
- package/{ext → packages}/markdown/src/structure/MarkdownLexer.ts +2 -2
- package/{ext → packages}/markdown/src/structure/MarkdownParser.ts +2 -1
- package/{ext → packages}/markdown/src/syntax/alert.ts +1 -1
- package/{ext → packages}/markdown/src/syntax/codeblock.ts +1 -1
- package/{ext → packages}/markdown/src/syntax/link.ts +2 -2
- package/{ext → packages}/markdown/src/syntax/list.ts +1 -1
- package/{ext → packages}/markdown/src/syntax/table.ts +1 -1
- package/packages/router/package.json +19 -0
- package/{ext → packages}/router/src/index.ts +4 -5
- package/{ext → packages}/router/src/node/Page.ts +8 -4
- package/{ext → packages}/router/src/node/Router.ts +79 -58
- package/{ext → packages}/router/src/node/RouterAnchor.ts +2 -2
- package/{ext → packages}/router/src/structure/PageBuilder.ts +3 -3
- package/{ext → packages}/router/src/structure/Route.ts +1 -1
- package/packages/signal/package.json +18 -0
- package/packages/signal/src/index.ts +221 -0
- package/{ext → packages}/signal/src/structure/Signal.ts +1 -1
- package/packages/ssr/package.json +19 -0
- package/packages/ssr/src/index.ts +38 -0
- package/{ext → packages}/ui/lib/VirtualScroll.ts +5 -5
- package/{ext → packages}/ui/node/Accordian.ts +4 -4
- package/packages/ui/node/Carousel.ts +20 -0
- package/{ext → packages}/ui/node/Form.ts +7 -6
- package/packages/ui/node/Modal.ts +45 -0
- package/{ext → packages}/ui/node/Table.ts +1 -1
- package/{ext → packages}/ui/node/Tabs.ts +28 -13
- package/{ext → packages}/ui/node/Toast.ts +2 -2
- 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 +5 -18
- package/{src/lib/native.ts → packages/utils/src/index.ts} +34 -1
- 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/idb/package.json +0 -13
- package/ext/markdown/package.json +0 -15
- package/ext/router/package.json +0 -10
- package/ext/signal/package.json +0 -9
- package/ext/signal/src/index.ts +0 -128
- package/ext/ssr/env.ts +0 -61
- package/ext/ssr/index.ts +0 -49
- package/ext/ssr/package.json +0 -10
- package/ext/ui/node/Waterfall.ts +0 -72
- package/ext/ui/package.json +0 -11
- package/src/index.ts +0 -2
- package/src/lib/chain.ts +0 -13
- package/src/lib/debounce.ts +0 -7
- package/src/lib/env.ts +0 -2
- 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/lib/uppercase.ts +0 -3
- /package/{src/node.ts → packages/core/src/lib/assignNodeProperties.ts} +0 -0
- /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}/i18n/README.md +0 -0
- /package/{ext → packages}/idb/README.md +0 -0
- /package/{ext → packages}/idb/src/core.ts +0 -0
- /package/{ext → packages}/markdown/README.md +0 -0
- /package/{ext → packages}/markdown/src/index.ts +0 -0
- /package/{ext → packages}/markdown/src/lib/type.ts +0 -0
- /package/{ext → packages}/markdown/src/structure/Markdown.ts +0 -0
- /package/{ext → packages}/markdown/src/syntax/blockquote.ts +0 -0
- /package/{ext → packages}/markdown/src/syntax/bold.ts +0 -0
- /package/{ext → packages}/markdown/src/syntax/code.ts +0 -0
- /package/{ext → packages}/markdown/src/syntax/heading.ts +0 -0
- /package/{ext → packages}/markdown/src/syntax/horizontalRule.ts +0 -0
- /package/{ext → packages}/markdown/src/syntax/image.ts +0 -0
- /package/{ext → packages}/markdown/src/syntax/italic.ts +0 -0
- /package/{ext → packages}/markdown/src/syntax/text.ts +0 -0
- /package/{ext → packages}/router/README.md +0 -0
- /package/{ext → packages}/signal/README.md +0 -0
- /package/{ext → packages}/ui/node/Grid.ts +0 -0
|
@@ -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;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { _Array_from, _instanceof, _Object_entries, forEach, startsWith } from "@amateras/utils";
|
|
2
|
+
import { $CSS, $CSSStyleRule } from "..";
|
|
3
|
+
import { $CSSContainerRule } from "#structure/$CSSContainerRule";
|
|
4
|
+
|
|
5
|
+
const CONTAINER = '@container'
|
|
6
|
+
|
|
7
|
+
$CSS.cssTextProcessors.add((rule, _, options) => {
|
|
8
|
+
if (_instanceof(rule, $CSSContainerRule)) {
|
|
9
|
+
const containerContext = [...options?.containerContext ?? [], rule.condition];
|
|
10
|
+
const container: string[] = [], style: string[] = [];
|
|
11
|
+
forEach(
|
|
12
|
+
_Array_from(rule.rules)
|
|
13
|
+
.map(childRule => $CSS.cssText(childRule, '', {...options, containerContext}))
|
|
14
|
+
.flat(),
|
|
15
|
+
(childText => startsWith(childText, CONTAINER) ? container.push(childText) : style.push(childText))
|
|
16
|
+
);
|
|
17
|
+
return [`${CONTAINER} ${rule.name} ${containerContext.join(' and ')} { ${style.join('\n')} }`, ...container]
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
$CSS.createRuleProcessors.add((selector, options, context) => {
|
|
22
|
+
if (startsWith(selector, CONTAINER)) {
|
|
23
|
+
const rule = new $CSSContainerRule(selector);
|
|
24
|
+
// create media rule from $.CSS
|
|
25
|
+
if (!context) forEach(_Object_entries(options), ([key, value]) => rule.rules.add( $CSS.createRule(key, value) ))
|
|
26
|
+
// create from $.css
|
|
27
|
+
else rule.rules.add( $CSS.CSSOptions(new $CSSStyleRule(context), options) );
|
|
28
|
+
return rule;
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export * from '#structure/$CSSContainerRule';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { _Object_assign, _Object_fromEntries, _Object_entries, forEach, _Array_from, _instanceof, startsWith } from "@amateras/utils";
|
|
2
|
+
import { $CSS, $CSSStyleRule, type $CSSDeclarations } from ".."
|
|
3
|
+
import { generateId } from "../lib/utils";
|
|
4
|
+
import { $CSSKeyframesRule } from "#structure/$CSSKeyframesRule";
|
|
5
|
+
|
|
6
|
+
declare module '@amateras/core' {
|
|
7
|
+
export namespace $ {
|
|
8
|
+
export namespace css {
|
|
9
|
+
export function keyframes<T extends { [key: string]: $CSSKeyframesType }>(options: T): { [key in keyof T]: $CSSKeyframesRule };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface $CSSGlobalDeclarationExtendsMap {
|
|
13
|
+
keyframes: $CSSKeyframesSelectorType;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface $CSSValueTypeExtendsMap {
|
|
17
|
+
keyframes: $CSSKeyframesRule
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type $CSSKeyframesSelectorType = { [key: `@keyframes ${string}`]: $CSSKeyframesType }
|
|
23
|
+
export type $CSSKeyframesType = { [key: `${number}%`]: $CSSDeclarations } | { from?: $CSSDeclarations, to?: $CSSDeclarations }
|
|
24
|
+
|
|
25
|
+
const KEYFRAMES = '@keyframes'
|
|
26
|
+
|
|
27
|
+
$CSS.valueInstances.add($CSSKeyframesRule)
|
|
28
|
+
|
|
29
|
+
$CSS.cssTextProcessors.add((rule, context, options) => {
|
|
30
|
+
if (_instanceof(rule, $CSSKeyframesRule))
|
|
31
|
+
return [`${KEYFRAMES} ${rule.name} { ${_Array_from(rule.rules).map(childRule => $CSS.cssText(childRule, context, options)).join('\n')} }`]
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
$CSS.createRuleProcessors.add((selector, options) => {
|
|
35
|
+
if (startsWith(selector, KEYFRAMES)) return createKeyframesRule(selector.replace('@keyframes ', ''), options as $CSSKeyframesType)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
_Object_assign($.css, {
|
|
39
|
+
keyframes(options: $CSSKeyframesType) {
|
|
40
|
+
return _Object_fromEntries( _Object_entries(options).map(([name, value]) => {
|
|
41
|
+
return [name, $CSS.insertRule( createKeyframesRule(`${name}_${generateId()}`, value) )];
|
|
42
|
+
}) )
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const createKeyframesRule = (name: string, options: $CSSKeyframesType) => {
|
|
47
|
+
const rule = new $CSSKeyframesRule(name);
|
|
48
|
+
forEach(_Object_entries(options), ([key, value]) => {
|
|
49
|
+
rule.rules.add( $CSS.CSSOptions(new $CSSStyleRule(key), value) );
|
|
50
|
+
})
|
|
51
|
+
return rule;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export * from '#structure/$CSSKeyframesRule'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { _Array_from, _instanceof, _Object_entries, forEach, startsWith } from "@amateras/utils";
|
|
2
|
+
import { $CSS, $CSSStyleRule } from "..";
|
|
3
|
+
import { $CSSMediaRule } from "#structure/$CSSMediaRule";
|
|
4
|
+
|
|
5
|
+
const MEDIA = '@media'
|
|
6
|
+
|
|
7
|
+
$CSS.cssTextProcessors.add((rule, _, options) => {
|
|
8
|
+
if (_instanceof(rule, $CSSMediaRule)) {
|
|
9
|
+
const mediaContext = [...options?.mediaContext ?? [], rule.condition];
|
|
10
|
+
const media: string[] = [], style: string[] = []
|
|
11
|
+
forEach(
|
|
12
|
+
_Array_from(rule.rules)
|
|
13
|
+
.map(childRule => $CSS.cssText(childRule, '', {...options, mediaContext}))
|
|
14
|
+
.flat(),
|
|
15
|
+
(childText => startsWith(childText, MEDIA) ? media.push(childText) : style.push(childText))
|
|
16
|
+
);
|
|
17
|
+
return [`${MEDIA} ${mediaContext.join(' and ')} { ${style.join('\n')} }`, ...media]
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
$CSS.createRuleProcessors.add((selector, options, context) => {
|
|
22
|
+
if (startsWith(selector, MEDIA)) {
|
|
23
|
+
const rule = new $CSSMediaRule(selector);
|
|
24
|
+
// create media rule from $.CSS
|
|
25
|
+
if (!context) forEach(_Object_entries(options), ([key, value]) => rule.rules.add( $CSS.createRule(key, value) ))
|
|
26
|
+
// create from $.css
|
|
27
|
+
else rule.rules.add( $CSS.CSSOptions(new $CSSStyleRule(context), options) );
|
|
28
|
+
return rule;
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
export * from '#structure/$CSSMediaRule';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { camelCaseToDash, generateId } from "#lib/utils";
|
|
2
|
+
import { $CSSProperty } from "#structure/$CSSProperty";
|
|
3
|
+
import { $CSS } from "..";
|
|
4
|
+
import { _instanceof, _Object_assign, _Object_entries, forEach, isString, isUndefined } from "@amateras/utils";
|
|
5
|
+
|
|
6
|
+
declare module '@amateras/core' {
|
|
7
|
+
export namespace $ {
|
|
8
|
+
export namespace css {
|
|
9
|
+
export function property<T extends $CSSPropertyMap>(resolver: T): { [key in keyof T]: $CSSProperty }
|
|
10
|
+
export function property(syntax: $CSSPropertySyntax, initialValue: string | number, inherits: boolean): $CSSProperty
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface $CSSValueTypeExtendsMap {
|
|
14
|
+
property: $CSSProperty
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type $CSSPropertySyntax =
|
|
20
|
+
'<angle>' | '<color>' | '<custom-ident>' |
|
|
21
|
+
'<image>' | '<integer>' | '<length>' |
|
|
22
|
+
'<length-percentage>' | '<number>' | '<percentage>' |
|
|
23
|
+
'<resolution>' | '<string>' | '<time>' |
|
|
24
|
+
'<transform-function>' | '<transform-list>' | '<url>' |
|
|
25
|
+
'auto' | '*' | string & {}
|
|
26
|
+
|
|
27
|
+
export type $CSSPropertyMap = { [key: string]: [$CSSPropertySyntax, string | number, boolean] }
|
|
28
|
+
|
|
29
|
+
_Object_assign($.css, {
|
|
30
|
+
property(resolver: $CSSPropertyMap | string, initialValue?: string | number, inherits?: boolean) {
|
|
31
|
+
if (isString(resolver)) {
|
|
32
|
+
if (isUndefined(initialValue) || isUndefined(inherits)) throw 'Register CSS Property Error';
|
|
33
|
+
const property = new $CSSProperty({ name: `--${generateId('lower')}`, syntax: resolver, initialValue: `${initialValue}`, inherits });
|
|
34
|
+
CSS.registerProperty(property)
|
|
35
|
+
return property;
|
|
36
|
+
} else {
|
|
37
|
+
const obj = {};
|
|
38
|
+
forEach(_Object_entries(resolver), ([key, [syntax, initialValue, inherits]]) => {
|
|
39
|
+
const property = new $CSSProperty({ name: `--${camelCaseToDash(key)}-${generateId('lower')}`, syntax, initialValue: `${initialValue}`, inherits });
|
|
40
|
+
_Object_assign(obj, { [key]: property });
|
|
41
|
+
CSS.registerProperty(property)
|
|
42
|
+
})
|
|
43
|
+
return obj;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
$CSS.valueInstances.add($CSSProperty);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { _Object_assign, _Object_entries, _Object_fromEntries, isObject } from "@amateras/utils";
|
|
2
|
+
import { $CSS, type $CSSValueType } from "..";
|
|
3
|
+
import { camelCaseToDash, generateId } from "../lib/utils";
|
|
4
|
+
import { $CSSVariable } from "#structure/$CSSVariable";
|
|
5
|
+
|
|
6
|
+
declare module '@amateras/core' {
|
|
7
|
+
export namespace $ {
|
|
8
|
+
export namespace css {
|
|
9
|
+
export function variable<V extends string>(value: V): $CSSVariable<V>;
|
|
10
|
+
export function variable<T extends $CSSVariableType>(options: T, conditions?: $CSSVariableConditionType<T>): { [key in keyof T]: $CSSVariable<T[key]> }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface $CSSValueTypeExtendsMap {
|
|
14
|
+
variable: $CSSVariable
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type $CSSVariableType<T = any> = { [key in keyof T]: $CSSValueType }
|
|
20
|
+
export type $CSSVariableConditionType<T extends $CSSVariableType | string> = T extends string ? { [key: string]: $CSSValueType } : { [key: string]: Partial<$CSSVariableType<T>> }
|
|
21
|
+
|
|
22
|
+
$CSS.valueInstances.add($CSSVariable)
|
|
23
|
+
|
|
24
|
+
_Object_assign($.css, {
|
|
25
|
+
variable<T extends $CSSVariableType | string>(options: T, conditions?: $CSSVariableConditionType<T>) {
|
|
26
|
+
if (isObject(options)) {
|
|
27
|
+
const variables = _Object_fromEntries(_Object_entries(options).map(([key, value]) => [
|
|
28
|
+
key,
|
|
29
|
+
new $CSSVariable(`--${camelCaseToDash(key)}_${generateId('lower')}`, `${value}`)
|
|
30
|
+
]))
|
|
31
|
+
|
|
32
|
+
const conditionObj = conditions ? _Object_entries(conditions).map(([condition, _options]) => [
|
|
33
|
+
condition,
|
|
34
|
+
_Object_fromEntries(_Object_entries(_options).map(([key, value]) => [`${variables[key]?.name}`, `${value}`] as const))
|
|
35
|
+
] as const) : [];
|
|
36
|
+
|
|
37
|
+
$.CSS({':root': {
|
|
38
|
+
..._Object_fromEntries(_Object_entries(variables).map(([_, {name, value}]) => [name, value])),
|
|
39
|
+
..._Object_fromEntries(conditionObj)
|
|
40
|
+
}})
|
|
41
|
+
|
|
42
|
+
return variables;
|
|
43
|
+
} else {
|
|
44
|
+
const variable = new $CSSVariable(`--${generateId('lower')}`, options);
|
|
45
|
+
$.CSS({':root': {[variable.name]: variable.value}});
|
|
46
|
+
return variable;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
export * from '#structure/$CSSVariable'
|