From 6b5b630569cf6c127fe00f7e9da169691301c673 Mon Sep 17 00:00:00 2001 From: htmujahid Date: Sun, 28 Apr 2024 23:56:58 +0500 Subject: [PATCH] refactoring packages --- .changeset/moody-glasses-buy.md | 7 + .changeset/purple-insects-guess.md | 7 +- apps/playground/src/main.ts | 3 +- apps/ssr-playground/src/entry-client.ts | 4 +- package-lock.json | 34 ++- packages/sonnet-core/package.json | 2 +- packages/sonnet-core/src/core/Sonnet.ts | 9 - .../core/{SonnetClient.ts => SonnetApp.ts} | 21 +- packages/sonnet-core/src/core/SonnetSSR.ts | 16 - packages/sonnet-core/src/index.ts | 3 +- packages/sonnet-dom/.eslintrc.cjs | 10 - packages/sonnet-dom/package.json | 57 ---- packages/sonnet-dom/src/core/dom/CElement.ts | 86 ------ .../sonnet-dom/src/core/dom/CEventTarget.ts | 3 - packages/sonnet-dom/src/core/dom/CNode.ts | 16 - packages/sonnet-dom/src/core/parser/index.ts | 62 ---- packages/sonnet-dom/src/index.ts | 3 - packages/sonnet-dom/tsconfig.json | 5 - packages/sonnet-dom/tsup.config.ts | 9 - packages/sonnet-html/.eslintrc.cjs | 10 - packages/sonnet-html/README.md | 135 --------- packages/sonnet-html/package.json | 58 ---- .../src/core/HtmlDom/CHTMLAnchorElement.ts | 147 --------- .../src/core/HtmlDom/CHTMLAreaElement.ts | 111 ------- .../src/core/HtmlDom/CHTMLAudioElement.ts | 21 -- .../src/core/HtmlDom/CHTMLBRElement.ts | 21 -- .../src/core/HtmlDom/CHTMLBaseElement.ts | 31 -- .../src/core/HtmlDom/CHTMLBodyElement.ts | 21 -- .../src/core/HtmlDom/CHTMLButtonElement.ts | 91 ------ .../src/core/HtmlDom/CHTMLCanvasElement.ts | 31 -- .../src/core/HtmlDom/CHTMLDListElement.ts | 21 -- .../src/core/HtmlDom/CHTMLDataElement.ts | 26 -- .../src/core/HtmlDom/CHTMLDataListElement.ts | 21 -- .../src/core/HtmlDom/CHTMLDetailsElement.ts | 26 -- .../src/core/HtmlDom/CHTMLDialogElement.ts | 31 -- .../src/core/HtmlDom/CHTMLDivElement.ts | 21 -- .../src/core/HtmlDom/CHTMLElement.ts | 281 ------------------ .../src/core/HtmlDom/CHTMLEmbedElement.ts | 41 --- .../src/core/HtmlDom/CHTMLFieldSetElement.ts | 31 -- .../src/core/HtmlDom/CHTMLFormElement.ts | 66 ---- .../src/core/HtmlDom/CHTMLHRElement.ts | 21 -- .../src/core/HtmlDom/CHTMLHeadElement.ts | 21 -- .../src/core/HtmlDom/CHTMLHeadingElement.ts | 41 --- .../src/core/HtmlDom/CHTMLHtmlElement.ts | 26 -- .../src/core/HtmlDom/CHTMLIFrameElement.ts | 76 ----- .../src/core/HtmlDom/CHTMLImageElement.ts | 81 ----- .../src/core/HtmlDom/CHTMLInputElement.ts | 226 -------------- .../src/core/HtmlDom/CHTMLLabelElement.ts | 26 -- .../src/core/HtmlDom/CHTMLLegendElement.ts | 21 -- .../src/core/HtmlDom/CHTMLLiElement.ts | 26 -- .../src/core/HtmlDom/CHTMLLinkElement.ts | 66 ---- .../src/core/HtmlDom/CHTMLMapElement.ts | 26 -- .../src/core/HtmlDom/CHTMLMediaElement.ts | 79 ----- .../src/core/HtmlDom/CHTMLMenuElement.ts | 21 -- .../src/core/HtmlDom/CHTMLMetaElement.ts | 46 --- .../src/core/HtmlDom/CHTMLMeterElement.ts | 51 ---- .../src/core/HtmlDom/CHTMLModElement.ts | 35 --- .../src/core/HtmlDom/CHTMLOListElement.ts | 36 --- .../src/core/HtmlDom/CHTMLObjectElement.ts | 46 --- .../src/core/HtmlDom/CHTMLOptGroupElement.ts | 31 -- .../src/core/HtmlDom/CHTMLOptionElement.ts | 51 ---- .../src/core/HtmlDom/CHTMLOutputElement.ts | 36 --- .../src/core/HtmlDom/CHTMLParagraphElement.ts | 21 -- .../src/core/HtmlDom/CHTMLPictureElement.ts | 21 -- .../src/core/HtmlDom/CHTMLPreElement.ts | 21 -- .../src/core/HtmlDom/CHTMLProgressElement.ts | 31 -- .../src/core/HtmlDom/CHTMLQuoteElement.ts | 30 -- .../src/core/HtmlDom/CHTMLScriptElement.ts | 61 ---- .../src/core/HtmlDom/CHTMLSelectElement.ts | 61 ---- .../src/core/HtmlDom/CHTMLSlotElement.ts | 26 -- .../src/core/HtmlDom/CHTMLSourceElement.ts | 56 ---- .../src/core/HtmlDom/CHTMLSpanElement.ts | 49 --- .../src/core/HtmlDom/CHTMLStyleElement.ts | 31 -- .../core/HtmlDom/CHTMLTableCaptionElement.ts | 21 -- .../src/core/HtmlDom/CHTMLTableCellElement.ts | 45 --- .../src/core/HtmlDom/CHTMLTableColElement.ts | 30 -- .../src/core/HtmlDom/CHTMLTableElement.ts | 21 -- .../src/core/HtmlDom/CHTMLTableRowElement.ts | 21 -- .../core/HtmlDom/CHTMLTableSectionElement.ts | 31 -- .../src/core/HtmlDom/CHTMLTemplateElement.ts | 21 -- .../src/core/HtmlDom/CHTMLTextAreaElement.ts | 115 ------- .../src/core/HtmlDom/CHTMLTimeElement.ts | 21 -- .../src/core/HtmlDom/CHTMLTitleElement.ts | 26 -- .../src/core/HtmlDom/CHTMLTrackElement.ts | 46 --- .../src/core/HtmlDom/CHTMLUListElement.ts | 21 -- .../src/core/HtmlDom/CHTMLVideoElement.ts | 46 --- packages/sonnet-html/src/index.ts | 105 ------- packages/sonnet-html/tsconfig.json | 5 - packages/sonnet-html/tsup.config.ts | 9 - packages/sonnet-ml/.eslintrc.cjs | 10 - packages/sonnet-ml/README.md | 67 ----- packages/sonnet-ml/package.json | 60 ---- packages/sonnet-ml/src/core/CMathMLElement.ts | 191 ------------ packages/sonnet-ml/src/index.ts | 28 -- packages/sonnet-ml/tsconfig.json | 5 - packages/sonnet-ml/tsup.config.ts | 9 - packages/sonnet-svg/.eslintrc.cjs | 10 - packages/sonnet-svg/README.md | 58 ---- packages/sonnet-svg/package.json | 60 ---- packages/sonnet-svg/src/core/CSVGAElement.ts | 123 -------- .../sonnet-svg/src/core/CSVGAnimateElement.ts | 59 ---- .../src/core/CSVGAnimateMotionElement.ts | 54 ---- .../src/core/CSVGAnimateTransformElement.ts | 64 ---- .../src/core/CSVGAnimationElement.ts | 99 ------ .../sonnet-svg/src/core/CSVGCircleElement.ts | 73 ----- .../src/core/CSVGClipPathElement.ts | 46 --- .../CSVGComponentTransferFunctionElement.ts | 41 --- .../sonnet-svg/src/core/CSVGDefsElement.ts | 31 -- .../sonnet-svg/src/core/CSVGDescElement.ts | 21 -- packages/sonnet-svg/src/core/CSVGElement.ts | 66 ---- .../sonnet-svg/src/core/CSVGEllipseElement.ts | 74 ----- .../sonnet-svg/src/core/CSVGFEBlendElement.ts | 59 ---- .../src/core/CSVGFEColorMatrixElement.ts | 64 ---- .../core/CSVGFEComponentTransferElement.ts | 49 --- .../src/core/CSVGFECompositeElement.ts | 94 ------ .../src/core/CSVGFEConvolveMatrixElement.ts | 120 -------- .../src/core/CSVGFEDiffuseLightingElement.ts | 71 ----- .../src/core/CSVGFEDisplacementMapElement.ts | 85 ------ .../src/core/CSVGFEDistantLightElement.ts | 45 --- .../src/core/CSVGFEDropShadowElement.ts | 85 ------ .../sonnet-svg/src/core/CSVGFEFloodElement.ts | 64 ---- .../sonnet-svg/src/core/CSVGFEFuncAElement.ts | 24 -- .../sonnet-svg/src/core/CSVGFEFuncBElement.ts | 24 -- .../sonnet-svg/src/core/CSVGFEFuncGElement.ts | 24 -- .../sonnet-svg/src/core/CSVGFEFuncRElement.ts | 24 -- .../src/core/CSVGFEGaussianBlurElement.ts | 71 ----- .../sonnet-svg/src/core/CSVGFEImageElement.ts | 72 ----- .../sonnet-svg/src/core/CSVGFEMergeElement.ts | 50 ---- .../src/core/CSVGFEMergeNodeElement.ts | 31 -- .../src/core/CSVGFEMorphologyElement.ts | 71 ----- .../src/core/CSVGFEOffsetElement.ts | 71 ----- .../src/core/CSVGFEPointLightElement.ts | 45 --- .../src/core/CSVGFESpecularLightingElement.ts | 92 ------ .../src/core/CSVGFESpotLightElement.ts | 80 ----- .../sonnet-svg/src/core/CSVGFETileElement.ts | 57 ---- .../src/core/CSVGFETurbulenceElement.ts | 90 ------ .../sonnet-svg/src/core/CSVGFilterElement.ts | 78 ----- .../src/core/CSVGForeignObjectElement.ts | 83 ------ packages/sonnet-svg/src/core/CSVGGElement.ts | 64 ---- .../src/core/CSVGGeometryElement.ts | 128 -------- .../src/core/CSVGGradientElement.ts | 30 -- .../src/core/CSVGGraphicsElement.ts | 37 --- .../sonnet-svg/src/core/CSVGImageElement.ts | 116 -------- .../sonnet-svg/src/core/CSVGLineElement.ts | 83 ------ .../src/core/CSVGLinearGradientElement.ts | 81 ----- .../sonnet-svg/src/core/CSVGMPathElement.ts | 33 -- .../sonnet-svg/src/core/CSVGMarkerElement.ts | 101 ------- .../sonnet-svg/src/core/CSVGMaskElement.ts | 80 ----- .../src/core/CSVGMetadataElement.ts | 24 -- .../sonnet-svg/src/core/CSVGPathElement.ts | 69 ----- .../sonnet-svg/src/core/CSVGPatternElement.ts | 116 -------- .../sonnet-svg/src/core/CSVGPolygonElement.ts | 72 ----- .../src/core/CSVGPolylineElement.ts | 72 ----- .../src/core/CSVGRadialGradientElement.ts | 75 ----- .../sonnet-svg/src/core/CSVGRectElement.ts | 81 ----- .../sonnet-svg/src/core/CSVGSVGElement.ts | 85 ------ .../sonnet-svg/src/core/CSVGScriptElement.ts | 49 --- .../sonnet-svg/src/core/CSVGSetElement.ts | 91 ------ .../sonnet-svg/src/core/CSVGStopElement.ts | 36 --- .../sonnet-svg/src/core/CSVGStyleElement.ts | 46 --- .../sonnet-svg/src/core/CSVGSwitchElement.ts | 39 --- .../sonnet-svg/src/core/CSVGTSpanElement.ts | 61 ---- .../src/core/CSVGTextContentElement.ts | 164 ---------- .../sonnet-svg/src/core/CSVGTextElement.ts | 70 ----- .../src/core/CSVGTextPathElement.ts | 74 ----- .../src/core/CSVGTextPositioningElement.ts | 9 - .../sonnet-svg/src/core/CSVGTitleElement.ts | 21 -- .../sonnet-svg/src/core/CSVGUseElement.ts | 72 ----- .../sonnet-svg/src/core/CSVGViewElement.ts | 26 -- packages/sonnet-svg/src/index.ts | 60 ---- packages/sonnet-svg/tsconfig.json | 5 - packages/sonnet-svg/tsup.config.ts | 9 - turbo.json | 12 +- 173 files changed, 70 insertions(+), 8773 deletions(-) create mode 100644 .changeset/moody-glasses-buy.md delete mode 100644 packages/sonnet-core/src/core/Sonnet.ts rename packages/sonnet-core/src/core/{SonnetClient.ts => SonnetApp.ts} (75%) delete mode 100644 packages/sonnet-core/src/core/SonnetSSR.ts delete mode 100644 packages/sonnet-dom/.eslintrc.cjs delete mode 100644 packages/sonnet-dom/package.json delete mode 100644 packages/sonnet-dom/src/core/dom/CElement.ts delete mode 100644 packages/sonnet-dom/src/core/dom/CEventTarget.ts delete mode 100644 packages/sonnet-dom/src/core/dom/CNode.ts delete mode 100644 packages/sonnet-dom/src/core/parser/index.ts delete mode 100644 packages/sonnet-dom/src/index.ts delete mode 100644 packages/sonnet-dom/tsconfig.json delete mode 100644 packages/sonnet-dom/tsup.config.ts delete mode 100644 packages/sonnet-html/.eslintrc.cjs delete mode 100644 packages/sonnet-html/README.md delete mode 100644 packages/sonnet-html/package.json delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLAnchorElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLAreaElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLAudioElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLBRElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLBaseElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLBodyElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLButtonElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLCanvasElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLDListElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLDataElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLDataListElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLDetailsElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLDialogElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLDivElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLEmbedElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLFieldSetElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLFormElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLHRElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLHeadElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLHeadingElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLHtmlElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLIFrameElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLImageElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLInputElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLLabelElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLLegendElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLLiElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLLinkElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLMapElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLMediaElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLMenuElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLMetaElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLMeterElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLModElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLOListElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLObjectElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLOptGroupElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLOptionElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLOutputElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLParagraphElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLPictureElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLPreElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLProgressElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLQuoteElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLScriptElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLSelectElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLSlotElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLSourceElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLSpanElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLStyleElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTableCaptionElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTableCellElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTableColElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTableElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTableRowElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTableSectionElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTemplateElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTextAreaElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTimeElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTitleElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLTrackElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLUListElement.ts delete mode 100644 packages/sonnet-html/src/core/HtmlDom/CHTMLVideoElement.ts delete mode 100644 packages/sonnet-html/src/index.ts delete mode 100644 packages/sonnet-html/tsconfig.json delete mode 100644 packages/sonnet-html/tsup.config.ts delete mode 100644 packages/sonnet-ml/.eslintrc.cjs delete mode 100644 packages/sonnet-ml/README.md delete mode 100644 packages/sonnet-ml/package.json delete mode 100644 packages/sonnet-ml/src/core/CMathMLElement.ts delete mode 100644 packages/sonnet-ml/src/index.ts delete mode 100644 packages/sonnet-ml/tsconfig.json delete mode 100644 packages/sonnet-ml/tsup.config.ts delete mode 100644 packages/sonnet-svg/.eslintrc.cjs delete mode 100644 packages/sonnet-svg/README.md delete mode 100644 packages/sonnet-svg/package.json delete mode 100644 packages/sonnet-svg/src/core/CSVGAElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGAnimateElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGAnimateMotionElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGAnimateTransformElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGAnimationElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGCircleElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGClipPathElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGComponentTransferFunctionElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGDefsElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGDescElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGEllipseElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEBlendElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEColorMatrixElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEComponentTransferElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFECompositeElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEConvolveMatrixElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEDiffuseLightingElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEDisplacementMapElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEDistantLightElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEDropShadowElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEFloodElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEFuncAElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEFuncBElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEFuncGElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEFuncRElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEGaussianBlurElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEImageElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEMergeElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEMergeNodeElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEMorphologyElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEOffsetElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFEPointLightElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFESpecularLightingElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFESpotLightElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFETileElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFETurbulenceElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGFilterElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGForeignObjectElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGGElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGGeometryElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGGradientElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGGraphicsElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGImageElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGLineElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGLinearGradientElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGMPathElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGMarkerElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGMaskElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGMetadataElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGPathElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGPatternElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGPolygonElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGPolylineElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGRadialGradientElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGRectElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGSVGElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGScriptElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGSetElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGStopElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGStyleElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGSwitchElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGTSpanElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGTextContentElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGTextElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGTextPathElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGTextPositioningElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGTitleElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGUseElement.ts delete mode 100644 packages/sonnet-svg/src/core/CSVGViewElement.ts delete mode 100644 packages/sonnet-svg/src/index.ts delete mode 100644 packages/sonnet-svg/tsconfig.json delete mode 100644 packages/sonnet-svg/tsup.config.ts diff --git a/.changeset/moody-glasses-buy.md b/.changeset/moody-glasses-buy.md new file mode 100644 index 0000000..2709d8c --- /dev/null +++ b/.changeset/moody-glasses-buy.md @@ -0,0 +1,7 @@ +--- +"@sonnetjs/core": patch +"ssr-playground": patch +"playground": patch +--- + +refactoring diff --git a/.changeset/purple-insects-guess.md b/.changeset/purple-insects-guess.md index 90219ca..7290eb2 100644 --- a/.changeset/purple-insects-guess.md +++ b/.changeset/purple-insects-guess.md @@ -1,8 +1,7 @@ --- -"@sonnetjs/dom": minor -"@sonnetjs/html": minor -"@sonnetjs/shared": minor -"@sonnetjs/store": minor +'@sonnetjs/dom': minor +'@sonnetjs/shared': minor +'@sonnetjs/store': minor --- summary diff --git a/apps/playground/src/main.ts b/apps/playground/src/main.ts index 3c6a9cb..f9a4b58 100644 --- a/apps/playground/src/main.ts +++ b/apps/playground/src/main.ts @@ -2,5 +2,6 @@ import './style.css'; import { createApp } from '@sonnetjs/core'; import Counter from './Counter'; -const app = createApp(Counter()); +const app = createApp(); +app.root(Counter()); app.mount('#app'); diff --git a/apps/ssr-playground/src/entry-client.ts b/apps/ssr-playground/src/entry-client.ts index 10ee0de..d17999d 100644 --- a/apps/ssr-playground/src/entry-client.ts +++ b/apps/ssr-playground/src/entry-client.ts @@ -2,5 +2,7 @@ import './style.css'; import { createApp } from '@sonnetjs/core'; import Counter from './Counter'; -const app = createApp(Counter()).ssr(); +const app = createApp(); +app.root(Counter()); +app.ssr(); app.mount('#app'); diff --git a/package-lock.json b/package-lock.json index ac5e61a..5027176 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "sonnetjs", + "name": "sonnet", "lockfileVersion": 3, "requires": true, "packages": { @@ -41,6 +41,18 @@ "vite": "^5.2.6" } }, + "apps/router-playground": { + "version": "0.0.1", + "dependencies": { + "@sonnetjs/core": "*", + "@sonnetjs/html": "*", + "@sonnetjs/router": "*" + }, + "devDependencies": { + "typescript": "^5.2.2", + "vite": "^5.2.6" + } + }, "apps/ssr-playground": { "version": "0.0.0", "dependencies": { @@ -2027,6 +2039,10 @@ "resolved": "packages/sonnet-ml", "link": true }, + "node_modules/@sonnetjs/router": { + "resolved": "packages/sonnet-router", + "link": true + }, "node_modules/@sonnetjs/shared": { "resolved": "packages/sonnet-shared", "link": true @@ -6340,6 +6356,10 @@ "fsevents": "~2.3.2" } }, + "node_modules/router-playground": { + "resolved": "apps/router-playground", + "link": true + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -8608,6 +8628,18 @@ "typescript": "^5.3.3" } }, + "packages/sonnet-router": { + "name": "@sonnetjs/router", + "version": "0.0.1", + "license": "MIT", + "devDependencies": { + "@repo/eslint-config": "*", + "@repo/typescript-config": "*", + "eslint": "^8.57.0", + "tsup": "^8.0.2", + "typescript": "^5.3.3" + } + }, "packages/sonnet-shared": { "name": "@sonnetjs/shared", "version": "0.0.1", diff --git a/packages/sonnet-core/package.json b/packages/sonnet-core/package.json index 9c4a30b..c590e47 100644 --- a/packages/sonnet-core/package.json +++ b/packages/sonnet-core/package.json @@ -1,6 +1,6 @@ { "name": "@sonnetjs/core", - "version": "0.0.17", + "version": "0.0.18", "files": [ "dist" ], diff --git a/packages/sonnet-core/src/core/Sonnet.ts b/packages/sonnet-core/src/core/Sonnet.ts deleted file mode 100644 index 8b0bb90..0000000 --- a/packages/sonnet-core/src/core/Sonnet.ts +++ /dev/null @@ -1,9 +0,0 @@ -import SonnetComponent from '../abstract/SonnetComponent'; - -export class Sonnet { - protected _component: SonnetComponent; - - constructor(component: SonnetComponent) { - this._component = component; - } -} diff --git a/packages/sonnet-core/src/core/SonnetClient.ts b/packages/sonnet-core/src/core/SonnetApp.ts similarity index 75% rename from packages/sonnet-core/src/core/SonnetClient.ts rename to packages/sonnet-core/src/core/SonnetApp.ts index 07d91c2..654eca9 100644 --- a/packages/sonnet-core/src/core/SonnetClient.ts +++ b/packages/sonnet-core/src/core/SonnetApp.ts @@ -1,26 +1,29 @@ import { isBrowser } from '@sonnetjs/shared'; -import SonnetComponent from '../abstract/SonnetComponent'; -import { Sonnet } from './Sonnet'; + import { EventEmitter } from './Event'; +import SonnetComponent from '../abstract/SonnetComponent'; const event = EventEmitter.getInstance(); -class SonnetClient extends Sonnet { +class SonnetApp { private _ssr: boolean = false; + private _component?: SonnetComponent; - constructor(component: SonnetComponent) { - super(component); - } + constructor() {} ssr(value: boolean = true) { this._ssr = value; return this; } + root(component: SonnetComponent) { + this._component = component; + } + async mount(selector: string) { if (!this._ssr && isBrowser()) { const el = document.querySelector(selector); - if (el) { + if (el && this._component) { const component = await this._component.get(); if (typeof component === 'string') { el.innerHTML = component as string; @@ -34,6 +37,6 @@ class SonnetClient extends Sonnet { } } -export function createApp(component: SonnetComponent) { - return new SonnetClient(component); +export function createApp() { + return new SonnetApp(); } diff --git a/packages/sonnet-core/src/core/SonnetSSR.ts b/packages/sonnet-core/src/core/SonnetSSR.ts deleted file mode 100644 index 308e56b..0000000 --- a/packages/sonnet-core/src/core/SonnetSSR.ts +++ /dev/null @@ -1,16 +0,0 @@ -import SonnetComponent from '../abstract/SonnetComponent'; -import { Sonnet } from './Sonnet'; - -class SonnetSSR extends Sonnet { - constructor(component: SonnetComponent) { - super(component); - } - - get() { - return this._component.get(); - } -} - -export function createSSRApp(component: SonnetComponent) { - return new SonnetSSR(component); -} diff --git a/packages/sonnet-core/src/index.ts b/packages/sonnet-core/src/index.ts index 111482a..1726537 100644 --- a/packages/sonnet-core/src/index.ts +++ b/packages/sonnet-core/src/index.ts @@ -1,4 +1,3 @@ export { default as SonnetComponent } from './abstract/SonnetComponent'; -export { createApp } from './core/SonnetClient'; +export { createApp } from './core/SonnetApp'; export { $component } from './core/factory'; -export { createSSRApp } from './core/SonnetSSR'; diff --git a/packages/sonnet-dom/.eslintrc.cjs b/packages/sonnet-dom/.eslintrc.cjs deleted file mode 100644 index 1ba520f..0000000 --- a/packages/sonnet-dom/.eslintrc.cjs +++ /dev/null @@ -1,10 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - ignorePatterns: [".eslintrc.cjs"], - extends: ["@repo/eslint-config/index.js"], - parser: "@typescript-eslint/parser", - parserOptions: { - project: true, - }, -}; diff --git a/packages/sonnet-dom/package.json b/packages/sonnet-dom/package.json deleted file mode 100644 index ea92600..0000000 --- a/packages/sonnet-dom/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "@sonnetjs/dom", - "version": "0.0.1", - "files": [ - "dist" - ], - "module": "./dist/index.mjs", - "types": "./dist/index.d.mts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "types": "./dist/index.d.mts" - } - }, - "author": "htmujahid", - "license": "MIT", - "scripts": { - "build": "tsup", - "dev": "tsup --watch", - "lint": "eslint \"**/*.ts\"" - }, - "devDependencies": { - "@repo/eslint-config": "*", - "@repo/typescript-config": "*", - "eslint": "^8.57.0", - "tsup": "^8.0.2", - "typescript": "^5.3.3" - }, - "dependencies": { - "@sonnetjs/shared": "*" - }, - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sonnetjs/sonnet.git" - }, - "bugs": { - "url": "https://github.com/sonnetjs/sonnet/issues" - }, - "homepage": "https://github.com/sonnetjs/sonnet/tree/main/packages/sonnet-dom#readme", - "tags": [ - "sonnet", - "web-components", - "web", - "dom" - ], - "keywords": [ - "sonnetjs", - "sonnet", - "web-components", - "components", - "web", - "frontend" - ] -} \ No newline at end of file diff --git a/packages/sonnet-dom/src/core/dom/CElement.ts b/packages/sonnet-dom/src/core/dom/CElement.ts deleted file mode 100644 index f0df60c..0000000 --- a/packages/sonnet-dom/src/core/dom/CElement.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; - -import { serverParse } from '../parser'; -import CNode from './CNode'; - -export default class CElement extends CNode { - public declare el?: Element; - - constructor() { - super(); - } - - public setAttribute(name: string, value: string) { - if (this.el) { - this.el.setAttribute(name, value); - } - return this; - } - - public className(value: string) { - if (this.el) { - this.el.className = value; - } - return this; - } - - public id(value: string) { - if (this.el) { - this.el.id = value; - } - return this; - } - - public innerHtml(value: string) { - if (this.el) { - this.el.innerHTML = value; - } - return this; - } - - public outerHtml(value: string) { - if (this.el) { - this.el.outerHTML = value; - } - return this; - } - - public scrollLeft(value: number) { - if (this.el) { - this.el.scrollLeft = value; - } - return this; - } - - public scrollTop(value: number) { - if (this.el) { - this.el.scrollTop = value; - } - return this; - } - - public slot(value: string) { - if (this.el) { - this.el.slot = value; - } - return this; - } - - public children(...value: (Node | string)[]) { - if (this.el) { - if (isServer()) { - this.el.innerHTML = value.join(''); - } else { - this.el.append(...value); - } - } - return this; - } - - public get() { - if (isServer()) { - return serverParse(this.el as HTMLElement); - } - return this.el as T; - } -} diff --git a/packages/sonnet-dom/src/core/dom/CEventTarget.ts b/packages/sonnet-dom/src/core/dom/CEventTarget.ts deleted file mode 100644 index b4ece80..0000000 --- a/packages/sonnet-dom/src/core/dom/CEventTarget.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default class CEventTarget { - constructor() {} -} diff --git a/packages/sonnet-dom/src/core/dom/CNode.ts b/packages/sonnet-dom/src/core/dom/CNode.ts deleted file mode 100644 index eb7e91a..0000000 --- a/packages/sonnet-dom/src/core/dom/CNode.ts +++ /dev/null @@ -1,16 +0,0 @@ -import CEventTarget from './CEventTarget'; - -export default class CNode extends CEventTarget { - public declare el?: Node; - - constructor() { - super(); - } - - public textContent(value: string) { - if (this.el) { - this.el.textContent = value; - } - return this; - } -} diff --git a/packages/sonnet-dom/src/core/parser/index.ts b/packages/sonnet-dom/src/core/parser/index.ts deleted file mode 100644 index 2fcd372..0000000 --- a/packages/sonnet-dom/src/core/parser/index.ts +++ /dev/null @@ -1,62 +0,0 @@ -export function serverParse(el: HTMLElement): T { - let attributes = ''; - - if (el?.outerHTML || el?.outerText) { - return (el?.outerHTML ?? el?.outerText) as T; - } - - for (const key in el) { - if (ommitAttributes.includes(key)) { - continue; - } else if (key === 'className') { - attributes += `class="${el[key as keyof HTMLElement]}" `; - } else if (key === 'dataset') { - for (const dataKey in el.dataset) { - attributes += `data-${dataKey}="${el.dataset[dataKey]}" `; - } - } else if (Object.prototype.hasOwnProperty.call(el, key)) { - const value = el[key as keyof HTMLElement]; - attributes += `${key}="${value}" `; - } - } - - if (isSelfClosingTag(el?.tagName as string)) { - return `<${el?.tagName} ${attributes}/>` as T; - } - - return `<${el?.tagName} ${attributes}>${ - el?.innerHTML ?? el?.innerText ?? el?.textContent ?? '' - }` as T; -} - -const ommitAttributes = [ - 'tagName', - 'innerHTML', - 'innerText', - 'textContent', - 'outerHTML', - 'outerText', -]; - -const selfClosingTags = [ - 'area', - 'base', - 'br', - 'col', - 'command', - 'embed', - 'hr', - 'img', - 'input', - 'keygen', - 'link', - 'meta', - 'param', - 'source', - 'track', - 'wbr', -]; - -function isSelfClosingTag(tagName: string) { - return selfClosingTags.indexOf(tagName.toLowerCase()) !== -1; -} diff --git a/packages/sonnet-dom/src/index.ts b/packages/sonnet-dom/src/index.ts deleted file mode 100644 index 2ed6127..0000000 --- a/packages/sonnet-dom/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { default as CElement } from './core/dom/CElement'; -export { default as CNode } from './core/dom/CNode'; -export { default as CEventTarget } from './core/dom/CEventTarget'; diff --git a/packages/sonnet-dom/tsconfig.json b/packages/sonnet-dom/tsconfig.json deleted file mode 100644 index 47044d8..0000000 --- a/packages/sonnet-dom/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "@repo/typescript-config/base.json", - "include": ["."], - "exclude": ["node_modules", "dist", "build"] -} diff --git a/packages/sonnet-dom/tsup.config.ts b/packages/sonnet-dom/tsup.config.ts deleted file mode 100644 index 620b3c8..0000000 --- a/packages/sonnet-dom/tsup.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig(() => ({ - entryPoints: ['src/index.ts'], - format: ['esm'], - dts: true, - sourcemap: false, - minify: true, -})); diff --git a/packages/sonnet-html/.eslintrc.cjs b/packages/sonnet-html/.eslintrc.cjs deleted file mode 100644 index 1ba520f..0000000 --- a/packages/sonnet-html/.eslintrc.cjs +++ /dev/null @@ -1,10 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - ignorePatterns: [".eslintrc.cjs"], - extends: ["@repo/eslint-config/index.js"], - parser: "@typescript-eslint/parser", - parserOptions: { - project: true, - }, -}; diff --git a/packages/sonnet-html/README.md b/packages/sonnet-html/README.md deleted file mode 100644 index a9427d1..0000000 --- a/packages/sonnet-html/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# sonnetjs/html - -sonnetjs/html is a framework for building web applications with a focus on simplicity and performance with native feel. It is built on top of vanilla JavaScript. - -## Features - -- **Simple**: sonnetjs/html is designed to be simple and easy to use. It is built on top of vanilla JavaScript and does not require any additional dependencies. - -- **Performance**: sonnetjs/html is designed to be fast and lightweight. It is built with performance in mind and does not include any unnecessary features. - -- **Native feel**: sonnetjs/html is designed to provide a native feel to web applications. It uses modern web technologies to provide a smooth and responsive user experience. - -## Usage - -1. Run the following command to create a new SonnetJS project. - -```bash -npx create-sonnet-app@latest -``` - -2. Change directory to the newly created project. - -```bash -cd [my-sonnet-app] -``` - -3. Install the dependencies - -```bash -npm i -``` - -4. Start the development server - -```bash -npm run dev -``` - -## Documentation - -### HTML Elements - -sonnetjs/html provides a set of functions to create HTML elements. These functions return an object that represents the HTML element and provides chainable methods to set attributes, properties, and children. - -```typescript -import { div, h1, p } from '@sonnetjs/html'; - -const element = div() - .id('container') - .className('container') - .children( - h1().innerText('Hello, World!').get(), - p().innerText('This is a paragraph.').get(), - ) - .get(); -``` - -### Attributes and Properties - -You can set attributes and properties of an HTML element using chainable methods. - -```typescript -import { a, img } from '@sonnetjs/html'; - -const element = a() - .href('https://example.com') - .target('blank') - .children(img().src('https://example.com/image.jpg').alt('Image').get()) - .get(); -``` - -### Children - -You can add children to an HTML element using children method. - -```typescript -import { div, h1, p } from '@sonnetjs/html'; - -const element = div() - .children( - h1().innerText('Hello, World!').get(), - p().innerText('This is a paragraph.').get(), - ) - .get(); -``` - -### Events - -You can add event listeners to an HTML element using js method. - -```typescript -import { button } from '@sonnetjs/html'; - -const element = button() - .innerText('Click me') - .js((el) => { - el.addEventListener('click', () => { - console.log('Button clicked'); - }); - }) - .get(); -``` - -### Refs - -You can create refs to an HTML element using ref method. - -```typescript -import { div, button, useRef } from '@sonnetjs/html'; - -let counter = 0; - -const Component = () => { - const divRef = useRef(null); - - return div() - .children( - button() - .innerText('Click me') - .js((el) => { - el.addEventListener('click', () => { - counter++; - divRef.current.innerText = `Counter: ${counter}`; - }); - }) - .get(), - div().ref(divRef).innerText(`Counter: ${counter}`).get(), - ) - .get(); -}; -``` - -## License - -sonnetjs/html is licensed under the MIT license. diff --git a/packages/sonnet-html/package.json b/packages/sonnet-html/package.json deleted file mode 100644 index eee09b6..0000000 --- a/packages/sonnet-html/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@sonnetjs/html", - "version": "0.0.1", - "files": [ - "dist" - ], - "module": "./dist/index.mjs", - "types": "./dist/index.d.mts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "types": "./dist/index.d.mts" - } - }, - "author": "htmujahid", - "license": "MIT", - "scripts": { - "build": "tsup", - "dev": "tsup --watch", - "lint": "eslint \"**/*.ts\"" - }, - "devDependencies": { - "@repo/eslint-config": "*", - "@repo/typescript-config": "*", - "eslint": "^8.57.0", - "tsup": "^8.0.2", - "typescript": "^5.3.3" - }, - "dependencies": { - "@sonnetjs/dom": "*", - "@sonnetjs/shared": "*" - }, - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sonnetjs/sonnet.git" - }, - "bugs": { - "url": "https://github.com/sonnetjs/sonnet/issues" - }, - "homepage": "https://github.com/sonnetjs/sonnet/tree/main/packages/sonnet-html#readme", - "tags": [ - "sonnet", - "web-components", - "web", - "html" - ], - "keywords": [ - "sonnetjs", - "sonnet", - "web-components", - "components", - "web", - "frontend" - ] -} \ No newline at end of file diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLAnchorElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLAnchorElement.ts deleted file mode 100644 index c9e8f15..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLAnchorElement.ts +++ /dev/null @@ -1,147 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLAnchorElement extends CHTMLElement { - public el: HTMLAnchorElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'a', - } as HTMLAnchorElement; - } else { - this.el = document.createElement('a'); - } - } - - public download(value: string) { - if (this.el) { - this.el.download = value; - } - return this; - } - - public hash(value: string) { - if (this.el) { - this.el.hash = value; - } - return this; - } - - public host(value: string) { - if (this.el) { - this.el.host = value; - } - return this; - } - - public hostname(value: string) { - if (this.el) { - this.el.hostname = value; - } - return this; - } - - public href(value: string) { - if (this.el) { - this.el.href = value; - } - return this; - } - - public hreflang(value: string) { - if (this.el) { - this.el.hreflang = value; - } - return this; - } - - public password(value: string) { - if (this.el) { - this.el.password = value; - } - return this; - } - - public pathname(value: string) { - if (this.el) { - this.el.pathname = value; - } - return this; - } - - public ping(value: string) { - if (this.el) { - this.el.ping = value; - } - return this; - } - - public port(value: string) { - if (this.el) { - this.el.port = value; - } - return this; - } - - public protocol(value: string) { - if (this.el) { - this.el.protocol = value; - } - return this; - } - - public referrerPolicy(value: string) { - if (this.el) { - this.el.referrerPolicy = value; - } - return this; - } - - public rel(value: string) { - if (this.el) { - this.el.rel = value; - } - return this; - } - - public search(value: string) { - if (this.el) { - this.el.search = value; - } - return this; - } - - public target(value: string) { - if (this.el) { - this.el.target = value; - } - return this; - } - - public text(value: string) { - if (this.el) { - this.el.text = value; - } - return this; - } - - public type(value: string) { - if (this.el) { - this.el.type = value; - } - return this; - } - - public username(value: string) { - if (this.el) { - this.el.username = value; - } - return this; - } -} - -export function a() { - return new CHTMLAnchorElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLAreaElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLAreaElement.ts deleted file mode 100644 index 5999516..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLAreaElement.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLAreaElement extends CHTMLElement { - public el: HTMLAreaElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'area', - } as HTMLAreaElement; - } else { - this.el = document.createElement('area'); - } - } - - public alt(value: string) { - this.el.alt = value; - return this; - } - - public coords(value: string) { - this.el.coords = value; - return this; - } - - public download(value: string) { - this.el.download = value; - return this; - } - - public hash(value: string) { - this.el.hash = value; - return this; - } - - public host(value: string) { - this.el.host = value; - return this; - } - - public hostname(value: string) { - this.el.hostname = value; - return this; - } - - public href(value: string) { - this.el.href = value; - return this; - } - - public password(value: string) { - this.el.password = value; - return this; - } - - public pathname(value: string) { - this.el.pathname = value; - return this; - } - - public ping(value: string) { - this.el.ping = value; - return this; - } - - public port(value: string) { - this.el.port = value; - return this; - } - - public protocol(value: string) { - this.el.protocol = value; - return this; - } - - public referrerPolicy(value: string) { - this.el.referrerPolicy = value; - return this; - } - - public rel(value: string) { - this.el.rel = value; - return this; - } - - public search(value: string) { - this.el.search = value; - return this; - } - - public shape(value: string) { - this.el.shape = value; - return this; - } - - public target(value: string) { - this.el.target = value; - return this; - } - - public username(value: string) { - this.el.username = value; - return this; - } -} - -export function area() { - return new CHTMLAreaElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLAudioElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLAudioElement.ts deleted file mode 100644 index df7be9c..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLAudioElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLMediaElement from './CHTMLMediaElement'; - -class CHTMLAudioElement extends CHTMLMediaElement { - public el: HTMLAudioElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'audio', - } as HTMLAudioElement; - } else { - this.el = document.createElement('audio'); - } - } -} - -export function audio() { - return new CHTMLAudioElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLBRElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLBRElement.ts deleted file mode 100644 index 56f63e2..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLBRElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLBRElement extends CHTMLElement { - public el: HTMLBRElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'br', - } as HTMLBRElement; - } else { - this.el = document.createElement('br'); - } - } -} - -export function br() { - return new CHTMLBRElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLBaseElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLBaseElement.ts deleted file mode 100644 index 1d972a4..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLBaseElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLBaseElement extends CHTMLElement { - public el: HTMLBaseElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'base', - } as HTMLBaseElement; - } else { - this.el = document.createElement('base'); - } - } - - public href(value: string) { - this.el.href = value; - return this; - } - - public target(value: string) { - this.el.target = value; - return this; - } -} - -export function base() { - return new CHTMLBaseElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLBodyElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLBodyElement.ts deleted file mode 100644 index a582116..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLBodyElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLBodyElement extends CHTMLElement { - public el: HTMLBodyElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'body', - } as HTMLBodyElement; - } else { - this.el = document.createElement('body'); - } - } -} - -export function body() { - return new CHTMLBodyElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLButtonElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLButtonElement.ts deleted file mode 100644 index 457d2f4..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLButtonElement.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLButtonElement extends CHTMLElement { - public el: HTMLButtonElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'button', - } as HTMLButtonElement; - } else { - this.el = document.createElement('button'); - } - } - - public disabled(value: boolean) { - if (this.el) { - this.el.disabled = value; - } - return this; - } - - public formAction(value: string) { - if (this.el) { - this.el.formAction = value; - } - return this; - } - - public formEncType(value: string) { - if (this.el) { - this.el.formEnctype = value; - } - return this; - } - - public formMethod(value: string) { - if (this.el) { - this.el.formMethod = value; - } - return this; - } - - public formNoValidate(value: boolean) { - if (this.el) { - this.el.formNoValidate = value; - } - return this; - } - - public formTarget(value: string) { - if (this.el) { - this.el.formTarget = value; - } - return this; - } - - public name(value: string) { - if (this.el) { - this.el.name = value; - } - return this; - } - - public popoverTargetAction(value: string) { - if (this.el) { - this.el.popoverTargetAction = value; - } - return this; - } - - public type(value: 'submit' | 'reset' | 'button') { - if (this.el) { - this.el.type = value; - } - return this; - } - - public value(value: string) { - if (this.el) { - this.el.value = value; - } - return this; - } -} - -export function button() { - return new CHTMLButtonElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLCanvasElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLCanvasElement.ts deleted file mode 100644 index 0c6fea8..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLCanvasElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLCanvasElement extends CHTMLElement { - public el: HTMLCanvasElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'canvas', - } as HTMLCanvasElement; - } else { - this.el = document.createElement('canvas'); - } - } - - public height(value: number) { - this.el.height = value; - return this; - } - - public width(value: number) { - this.el.width = value; - return this; - } -} - -export function canvas() { - return new CHTMLCanvasElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLDListElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLDListElement.ts deleted file mode 100644 index 2275d41..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLDListElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLDListElement extends CHTMLElement { - public el: HTMLDListElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'dl', - } as HTMLDListElement; - } else { - this.el = document.createElement('dl'); - } - } -} - -export function dl() { - return new CHTMLDListElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLDataElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLDataElement.ts deleted file mode 100644 index 4d9cc24..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLDataElement.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLDataElement extends CHTMLElement { - public el: HTMLDataElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'data', - } as HTMLDataElement; - } else { - this.el = document.createElement('data'); - } - } - - public value(value: string) { - this.el.value = value; - return this; - } -} - -export function data() { - return new CHTMLDataElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLDataListElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLDataListElement.ts deleted file mode 100644 index 16f6459..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLDataListElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLDataListElement extends CHTMLElement { - public el: HTMLDataListElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'datalist', - } as HTMLDataListElement; - } else { - this.el = document.createElement('datalist'); - } - } -} - -export function datalist() { - return new CHTMLDataListElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLDetailsElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLDetailsElement.ts deleted file mode 100644 index dddc9d6..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLDetailsElement.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLDetailsElement extends CHTMLElement { - public el: HTMLDetailsElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'details', - } as HTMLDetailsElement; - } else { - this.el = document.createElement('details'); - } - } - - public open(value: boolean = true) { - this.el.open = value; - return this; - } -} - -export function details() { - return new CHTMLDetailsElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLDialogElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLDialogElement.ts deleted file mode 100644 index 38b4717..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLDialogElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLDialogElement extends CHTMLElement { - public el: HTMLDialogElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'dialog', - } as HTMLDialogElement; - } else { - this.el = document.createElement('dialog'); - } - } - - public open(value: boolean = true) { - this.el.open = value; - return this; - } - - public returnValue(value: string) { - this.el.returnValue = value; - return this; - } -} - -export function dialog() { - return new CHTMLDialogElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLDivElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLDivElement.ts deleted file mode 100644 index 58112e6..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLDivElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLDivElement extends CHTMLElement { - public el: HTMLDivElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'div', - } as HTMLDivElement; - } else { - this.el = document.createElement('div'); - } - } -} - -export function div() { - return new CHTMLDivElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLElement.ts deleted file mode 100644 index 3ed22f2..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLElement.ts +++ /dev/null @@ -1,281 +0,0 @@ -import { CElement } from '@sonnetjs/dom'; -import { isServer } from '@sonnetjs/shared'; - -export default class CHTMLElement extends CElement { - public declare el?: HTMLElement; - - constructor(tag?: string) { - super(); - if (tag) { - if (isServer()) { - this.el = { - tagName: tag, - } as HTMLElement; - } else { - this.el = document.createElement(tag); - } - } - } - - public dataset(name: string, value: string) { - if (this.el) { - this.el.dataset[name] = value; - } - return this; - } - - public accessKey(value: string) { - if (this.el) { - this.el.accessKey = value; - } - return this; - } - - public autoFocus(value: boolean) { - if (this.el) { - this.el.autofocus = value; - } - return this; - } - - public contentEditable(value: 'true' | 'false' | 'plaintext-only') { - if (this.el) { - this.el.contentEditable = value; - } - return this; - } - - public dir(value: 'ltr' | 'rtl' | 'auto') { - if (this.el) { - this.el.dir = value; - } - return this; - } - - public draggable(value: boolean) { - if (this.el) { - this.el.draggable = value; - } - return this; - } - - public enterKeyHint(value: string) { - if (this.el) { - this.el.enterKeyHint = value; - } - return this; - } - - public hidden(value: boolean) { - if (this.el) { - this.el.hidden = value; - } - return this; - } - - public inert(value: boolean) { - if (this.el) { - this.el.inert = value; - } - return this; - } - - public innerText(value: string) { - if (this.el) { - this.el.innerText = value; - } - return this; - } - - public lang(value: string) { - if (this.el) { - this.el.lang = value; - } - return this; - } - - public nonce(value: string) { - if (this.el) { - this.el.nonce = value; - } - return this; - } - - public outerText(value: string) { - if (this.el) { - this.el.outerText = value; - } - return this; - } - - public popover(value: string) { - if (this.el) { - this.el.title = value; - } - return this; - } - - public spellcheck(value: boolean) { - if (this.el) { - this.el.spellcheck = value; - } - return this; - } - - public style(value: CSSStyleDeclaration | Record) { - if (this.el) { - // this.el.style.cssText = value; - Object.assign(this.el.style, value); - } - return this; - } - - public tabIndex(value: number) { - if (this.el) { - this.el.tabIndex = value; - } - return this; - } - - public title(value: string) { - if (this.el) { - this.el.title = value; - } - return this; - } - - public translate(value: boolean) { - if (this.el) { - this.el.translate = value; - } - return this; - } -} - -export function article() { - return new CHTMLElement('article'); -} - -export function aside() { - return new CHTMLElement('aside'); -} - -export function footer() { - return new CHTMLElement('footer'); -} - -export function header() { - return new CHTMLElement('header'); -} - -export function hgroup() { - return new CHTMLElement('hgroup'); -} - -export function main() { - return new CHTMLElement('main'); -} - -export function nav() { - return new CHTMLElement('nav'); -} - -export function section() { - return new CHTMLElement('section'); -} - -export function search() { - return new CHTMLElement('search'); -} - -export function dd() { - return new CHTMLElement('dd'); -} - -export function figcaption() { - return new CHTMLElement('figcaption'); -} - -export function figure() { - return new CHTMLElement('figure'); -} - -export function abbr() { - return new CHTMLElement('abbr'); -} - -export function b() { - return new CHTMLElement('b'); -} - -export function bdi() { - return new CHTMLElement('bdi'); -} - -export function dfn() { - return new CHTMLElement('dfn'); -} - -export function kbd() { - return new CHTMLElement('kbd'); -} - -export function mark() { - return new CHTMLElement('mark'); -} - -export function rp() { - return new CHTMLElement('rp'); -} - -export function rt() { - return new CHTMLElement('rt'); -} - -export function ruby() { - return new CHTMLElement('ruby'); -} - -export function s() { - return new CHTMLElement('s'); -} - -export function samp() { - return new CHTMLElement('samp'); -} - -export function small() { - return new CHTMLElement('small'); -} - -export function strong() { - return new CHTMLElement('strong'); -} - -export function sub() { - return new CHTMLElement('sub'); -} - -export function sup() { - return new CHTMLElement('sup'); -} - -export function u() { - return new CHTMLElement('u'); -} - -export function variable() { - return new CHTMLElement('var'); -} - -export function wbr() { - return new CHTMLElement('wbr'); -} - -export function noscript() { - return new CHTMLElement('noscript'); -} - -export function summary() { - return new CHTMLElement('summary'); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLEmbedElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLEmbedElement.ts deleted file mode 100644 index 36fd2d1..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLEmbedElement.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLEmbedElement extends CHTMLElement { - public el: HTMLEmbedElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'embed', - } as HTMLEmbedElement; - } else { - this.el = document.createElement('embed'); - } - } - - public height(value: string) { - this.el.height = value; - return this; - } - - public src(value: string) { - this.el.src = value; - return this; - } - - public type(value: string) { - this.el.type = value; - return this; - } - - public width(value: string) { - this.el.width = value; - return this; - } -} - -export function embed() { - return new CHTMLEmbedElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLFieldSetElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLFieldSetElement.ts deleted file mode 100644 index ee74b40..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLFieldSetElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLFieldSetElement extends CHTMLElement { - public el: HTMLFieldSetElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'fieldset', - } as HTMLFieldSetElement; - } else { - this.el = document.createElement('fieldset'); - } - } - - public disabled(value: boolean) { - this.el.disabled = value; - return this; - } - - public name(value: string) { - this.el.name = value; - return this; - } -} - -export function fieldset() { - return new CHTMLFieldSetElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLFormElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLFormElement.ts deleted file mode 100644 index 98b5bf0..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLFormElement.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLFormElement extends CHTMLElement { - public el: HTMLFormElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'form', - } as HTMLFormElement; - } else { - this.el = document.createElement('form'); - } - } - - public name(value: string) { - this.el.name = value; - return this; - } - - public action(value: string) { - this.el.action = value; - return this; - } - - public method(value: string) { - this.el.method = value; - return this; - } - - public target(value: string) { - this.el.target = value; - return this; - } - - public enctype(value: string) { - this.el.enctype = value; - return this; - } - - public encoding(value: string) { - this.el.encoding = value; - return this; - } - - public acceptCharset(value: string) { - this.el.acceptCharset = value; - return this; - } - - public autocomplete(value: AutoFillBase) { - this.el.autocomplete = value; - return this; - } - - public noValidate(value: boolean) { - this.el.noValidate = value; - return this; - } -} - -export function form() { - return new CHTMLFormElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLHRElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLHRElement.ts deleted file mode 100644 index d4e4a14..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLHRElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLHRElement extends CHTMLElement { - public el: HTMLHRElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'hr', - } as HTMLHRElement; - } else { - this.el = document.createElement('hr'); - } - } -} - -export function hr() { - return new CHTMLHRElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLHeadElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLHeadElement.ts deleted file mode 100644 index 18a89e1..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLHeadElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLHeadElement extends CHTMLElement { - public el: HTMLHeadElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'head', - } as HTMLHeadElement; - } else { - this.el = document.createElement('head'); - } - } -} - -export function head() { - return new CHTMLHeadElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLHeadingElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLHeadingElement.ts deleted file mode 100644 index 49608b6..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLHeadingElement.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLHeadingElement extends CHTMLElement { - public el: HTMLHeadingElement; - - constructor(level: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6') { - super(); - if (isServer()) { - this.el = { - tagName: level, - } as HTMLHeadingElement; - } else { - this.el = document.createElement(level); - } - } -} - -export function h1() { - return new CHTMLHeadingElement('h1'); -} - -export function h2() { - return new CHTMLHeadingElement('h2'); -} - -export function h3() { - return new CHTMLHeadingElement('h3'); -} - -export function h4() { - return new CHTMLHeadingElement('h4'); -} - -export function h5() { - return new CHTMLHeadingElement('h5'); -} - -export function h6() { - return new CHTMLHeadingElement('h6'); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLHtmlElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLHtmlElement.ts deleted file mode 100644 index 8763033..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLHtmlElement.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLHtmlElement extends CHTMLElement { - public el: HTMLHtmlElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'html', - } as HTMLHtmlElement; - } else { - this.el = document.createElement('html'); - } - } - - public version(version: string) { - this.el.version = version; - return this; - } -} - -export function html() { - return new CHTMLHtmlElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLIFrameElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLIFrameElement.ts deleted file mode 100644 index 3a1a19b..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLIFrameElement.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLIFrameElement extends CHTMLElement { - public el: HTMLIFrameElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'iframe', - } as HTMLIFrameElement; - } else { - this.el = document.createElement('iframe'); - } - } - - public allow(value: string) { - this.el.allow = value; - return this; - } - - public allowfullscreen(value: boolean) { - this.el.allowFullscreen = value; - return this; - } - - public height(value: string) { - this.el.height = value; - return this; - } - - public loading(value: string) { - this.el.loading = value; - return this; - } - - public name(value: string) { - this.el.name = value; - return this; - } - - public referrerpolicy( - value: - | 'no-referrer' - | 'no-referrer-when-downgrade' - | 'origin' - | 'origin-when-cross-origin' - | 'same-origin' - | 'strict-origin' - | 'strict-origin-when-cross-origin' - | 'unsafe-url', - ) { - this.el.referrerPolicy = value; - return this; - } - - public src(value: string) { - this.el.src = value; - return this; - } - - public srcdoc(value: string) { - this.el.srcdoc = value; - return this; - } - - public width(value: string) { - this.el.width = value; - return this; - } -} - -export function iframe() { - return new CHTMLIFrameElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLImageElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLImageElement.ts deleted file mode 100644 index a4f7ee1..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLImageElement.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLImageElement extends CHTMLElement { - public el: HTMLImageElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'img', - } as HTMLImageElement; - } else { - this.el = document.createElement('img'); - } - } - - public alt(alt: string) { - this.el.alt = alt; - return this; - } - - public crossOrigin(value: string) { - this.el.crossOrigin = value; - return this; - } - - public decoding(value: 'async' | 'sync' | 'auto') { - this.el.decoding = value; - return this; - } - - public height(value: number) { - this.el.height = value; - return this; - } - - public isMap(value: boolean) { - this.el.isMap = value; - return this; - } - - public loading(value: 'eager' | 'lazy') { - this.el.loading = value; - return this; - } - - public referrerPolicy(value: string) { - this.el.referrerPolicy = value; - return this; - } - - public sizes(value: string) { - this.el.sizes = value; - return this; - } - - public src(value: string) { - this.el.src = value; - return this; - } - - public srcset(value: string) { - this.el.srcset = value; - return this; - } - - public useMap(value: string) { - this.el.useMap = value; - return this; - } - - public width(value: number) { - this.el.width = value; - return this; - } -} - -export function img() { - return new CHTMLImageElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLInputElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLInputElement.ts deleted file mode 100644 index e6dbc79..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLInputElement.ts +++ /dev/null @@ -1,226 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLInputElement extends CHTMLElement { - public el: HTMLInputElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'input', - } as HTMLInputElement; - } else { - this.el = document.createElement('input'); - } - } - - public defaultValue(value: string) { - this.el.defaultValue = value; - return this; - } - - public dirName(value: string) { - this.el.dirName = value; - return this; - } - - public multiple(value: boolean) { - this.el.multiple = value; - return this; - } - - public name(value: string) { - this.el.name = value; - return this; - } - - public popoverTargetAction(value: string) { - this.el.popoverTargetAction = value; - return this; - } - - public popoverTargetElement(value: Element) { - this.el.popoverTargetElement = value; - return this; - } - - public step(value: string) { - this.el.step = value; - return this; - } - - public type(value: string) { - this.el.type = value; - return this; - } - - public value(value: string) { - this.el.value = value; - return this; - } - - public valueAsDate(value: Date) { - this.el.valueAsDate = value; - return this; - } - - public valueAsNumber(value: number) { - this.el.valueAsNumber = value; - return this; - } - - public formAction(value: string) { - this.el.formAction = value; - return this; - } - - public formEnctype(value: string) { - this.el.formEnctype = value; - return this; - } - - public formMethod(value: string) { - this.el.formMethod = value; - return this; - } - - public formNoValidate(value: boolean) { - this.el.formNoValidate = value; - return this; - } - - public formTarget(value: string) { - this.el.formTarget = value; - return this; - } - - public disabled(value: boolean) { - this.el.disabled = value; - return this; - } - - public required(value: boolean) { - this.el.required = value; - return this; - } - - public checked(value: boolean) { - this.el.checked = value; - return this; - } - - public defaultChecked(value: boolean) { - this.el.defaultChecked = value; - return this; - } - - public indeterminate(value: boolean) { - this.el.indeterminate = value; - return this; - } - - public alt(value: string) { - this.el.alt = value; - return this; - } - - public height(value: number) { - this.el.height = value; - return this; - } - - public src(value: string) { - this.el.src = value; - return this; - } - - public width(value: number) { - this.el.width = value; - return this; - } - - public accept(value: string) { - this.el.accept = value; - return this; - } - - public files(value: FileList) { - this.el.files = value; - return this; - } - - public webkitdirectory(value: boolean) { - this.el.webkitdirectory = value; - return this; - } - - public autocomplete(value: AutoFill) { - this.el.autocomplete = value; - return this; - } - - public capture(value: string) { - this.el.capture = value; - return this; - } - - public max(value: string) { - this.el.max = value; - return this; - } - - public maxLength(value: number) { - this.el.maxLength = value; - return this; - } - - public min(value: string) { - this.el.min = value; - return this; - } - - public minLength(value: number) { - this.el.minLength = value; - return this; - } - - public pattern(value: string) { - this.el.pattern = value; - return this; - } - - public placeholder(value: string) { - this.el.placeholder = value; - return this; - } - - public readOnly(value: boolean) { - this.el.readOnly = value; - return this; - } - - public selectionDirection(value: 'forward' | 'backward' | 'none') { - this.el.selectionDirection = value; - return this; - } - - public selectionEnd(value: number) { - this.el.selectionEnd = value; - return this; - } - - public selectionStart(value: number) { - this.el.selectionStart = value; - return this; - } - - public size(value: number) { - this.el.size = value; - return this; - } -} - -export function input() { - return new CHTMLInputElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLLabelElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLLabelElement.ts deleted file mode 100644 index 01423b4..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLLabelElement.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLLabelElement extends CHTMLElement { - public el: HTMLLabelElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'label', - } as HTMLLabelElement; - } else { - this.el = document.createElement('label'); - } - } - - public htmlFor(value: string) { - this.el.htmlFor = value; - return this; - } -} - -export function label() { - return new CHTMLLabelElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLLegendElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLLegendElement.ts deleted file mode 100644 index ccf92a3..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLLegendElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLLegendElement extends CHTMLElement { - public el: HTMLLegendElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'legend', - } as HTMLLegendElement; - } else { - this.el = document.createElement('legend'); - } - } -} - -export function legend() { - return new CHTMLLegendElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLLiElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLLiElement.ts deleted file mode 100644 index 105da27..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLLiElement.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLLIElement extends CHTMLElement { - public el: HTMLLIElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'li', - } as HTMLLIElement; - } else { - this.el = document.createElement('li'); - } - } - - public value(value: string) { - this.el.innerText = value; - return this; - } -} - -export function li() { - return new CHTMLLIElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLLinkElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLLinkElement.ts deleted file mode 100644 index 68bf575..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLLinkElement.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLLinkElement extends CHTMLElement { - public el: HTMLLinkElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'link', - } as HTMLLinkElement; - } else { - this.el = document.createElement('link'); - } - } - - public as(value: string) { - this.el.as = value; - return this; - } - - public crossOrigin(value: string) { - this.el.crossOrigin = value; - return this; - } - - public disabled(value: boolean) { - this.el.disabled = value; - return this; - } - - public href(value: string) { - this.el.href = value; - return this; - } - - public hreflang(value: string) { - this.el.hreflang = value; - return this; - } - - public media(value: string) { - this.el.media = value; - return this; - } - - public referrerPolicy(value: string) { - this.el.referrerPolicy = value; - return this; - } - - public rel(value: string) { - this.el.rel = value; - return this; - } - - public type(value: string) { - this.el.type = value; - return this; - } -} - -export function link() { - return new CHTMLLinkElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLMapElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLMapElement.ts deleted file mode 100644 index 2f0bf6e..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLMapElement.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLMapElement extends CHTMLElement { - public el: HTMLMapElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'map', - } as HTMLMapElement; - } else { - this.el = document.createElement('map'); - } - } - - public name(value: string) { - this.el.name = value; - return this; - } -} - -export function map() { - return new CHTMLMapElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLMediaElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLMediaElement.ts deleted file mode 100644 index 58d9740..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLMediaElement.ts +++ /dev/null @@ -1,79 +0,0 @@ -import CHTMLElement from './CHTMLElement'; - -export default class CHTMLMediaElement extends CHTMLElement { - declare public el: HTMLMediaElement; - - constructor() { - super(); - } - - public autoplay(value: boolean) { - this.el.autoplay = value; - return this; - } - - public controls(value: boolean) { - this.el.controls = value; - return this; - } - - public crossOrigin(value: string) { - this.el.crossOrigin = value; - return this; - } - - public currentTime(value: number) { - this.el.currentTime = value; - return this; - } - - public defaultMuted(value: boolean) { - this.el.defaultMuted = value; - return this; - } - - public defaultPlaybackRate(value: number) { - this.el.defaultPlaybackRate = value; - return this; - } - - public disableRemotePlayback(value: boolean) { - this.el.disableRemotePlayback = value; - return this; - } - - public loop(value: boolean) { - this.el.loop = value; - return this; - } - - public muted(value: boolean) { - this.el.muted = value; - return this; - } - - public playbackRate(value: number) { - this.el.playbackRate = value; - return this; - } - - public preservesPitch(value: boolean) { - this.el.preservesPitch = value; - return this; - } - - public src(value: string) { - this.el.src = value; - return this; - } - - public srcObject(value: MediaStream) { - this.el.srcObject = value; - return this; - } - - public volume(value: number) { - this.el.volume = value; - return this; - } -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLMenuElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLMenuElement.ts deleted file mode 100644 index 98bba39..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLMenuElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLMenuElement extends CHTMLElement { - public el: HTMLMenuElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'menu', - } as HTMLMenuElement; - } else { - this.el = document.createElement('menu'); - } - } -} - -export function menu() { - return new CHTMLMenuElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLMetaElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLMetaElement.ts deleted file mode 100644 index 6a132e4..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLMetaElement.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLMetaElement extends CHTMLElement { - public el: HTMLMetaElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'meta', - } as HTMLMetaElement; - } else { - this.el = document.createElement('meta'); - } - } - - public content(value: string) { - this.el.content = value; - return this; - } - - public httpEquiv(value: string) { - this.el.httpEquiv = value; - return this; - } - - public media(value: string) { - this.el.media = value; - return this; - } - - public name(value: string) { - this.el.name = value; - return this; - } - - public scheme(value: string) { - this.el.scheme = value; - return this; - } -} - -export function meta() { - return new CHTMLMetaElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLMeterElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLMeterElement.ts deleted file mode 100644 index 44d3aec..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLMeterElement.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLMeterElement extends CHTMLElement { - public el: HTMLMeterElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'meter', - } as HTMLMeterElement; - } else { - this.el = document.createElement('meter'); - } - } - - public high(value: number) { - this.el.high = value; - return this; - } - - public low(value: number) { - this.el.low = value; - return this; - } - - public max(value: number) { - this.el.max = value; - return this; - } - - public min(value: number) { - this.el.min = value; - return this; - } - - public optimum(value: number) { - this.el.optimum = value; - return this; - } - - public value(value: number) { - this.el.value = value; - return this; - } -} - -export function meter() { - return new CHTMLMeterElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLModElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLModElement.ts deleted file mode 100644 index f2b5a82..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLModElement.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLModElement extends CHTMLElement { - public el: HTMLModElement; - - constructor(tag: 'del' | 'ins') { - super(); - if (isServer()) { - this.el = { - tagName: tag, - } as HTMLModElement; - } else { - this.el = document.createElement(tag); - } - } - - public cite(value: string) { - this.el.cite = value; - return this; - } - - public dateTime(value: string) { - this.el.dateTime = value; - return this; - } -} - -export function del() { - return new CHTMLModElement('del'); -} - -export function ins() { - return new CHTMLModElement('ins'); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLOListElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLOListElement.ts deleted file mode 100644 index fab7c47..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLOListElement.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLOListElement extends CHTMLElement { - public el: HTMLOListElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'ol', - } as HTMLOListElement; - } else { - this.el = document.createElement('ol'); - } - } - - public reversed(value: boolean) { - this.el.reversed = value; - return this; - } - - public start(value: number) { - this.el.start = value; - return this; - } - - public type(value: '1' | 'a' | 'A' | 'i' | 'I') { - this.el.type = value; - return this; - } -} - -export function ol() { - return new CHTMLOListElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLObjectElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLObjectElement.ts deleted file mode 100644 index 04950f0..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLObjectElement.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLObjectElement extends CHTMLElement { - public el: HTMLObjectElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'object', - } as HTMLObjectElement; - } else { - this.el = document.createElement('object'); - } - } - - public data(value: string) { - this.el.data = value; - return this; - } - - public height(value: string) { - this.el.height = value; - return this; - } - - public name(value: string) { - this.el.name = value; - return this; - } - - public type(value: string) { - this.el.type = value; - return this; - } - - public width(value: string) { - this.el.width = value; - return this; - } -} - -export function object() { - return new CHTMLObjectElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLOptGroupElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLOptGroupElement.ts deleted file mode 100644 index 0b36280..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLOptGroupElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLOptGroupElement extends CHTMLElement { - public el: HTMLOptGroupElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'optgroup', - } as HTMLOptGroupElement; - } else { - this.el = document.createElement('optgroup'); - } - } - - public disabled(value: boolean) { - this.el.disabled = value; - return this; - } - - public label(value: string) { - this.el.label = value; - return this; - } -} - -export function optgroup() { - return new CHTMLOptGroupElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLOptionElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLOptionElement.ts deleted file mode 100644 index 408ee12..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLOptionElement.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLOptionElement extends CHTMLElement { - public el: HTMLOptionElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'option', - } as HTMLOptionElement; - } else { - this.el = document.createElement('option'); - } - } - - public disabled(value: boolean) { - this.el.disabled = value; - return this; - } - - public defaultSelected(value: boolean) { - this.el.defaultSelected = value; - return this; - } - - public label(value: string) { - this.el.label = value; - return this; - } - - public selected(value: boolean) { - this.el.selected = value; - return this; - } - - public text(value: string) { - this.el.text = value; - return this; - } - - public value(value: string) { - this.el.value = value; - return this; - } -} - -export function option() { - return new CHTMLOptionElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLOutputElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLOutputElement.ts deleted file mode 100644 index afd3af6..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLOutputElement.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLOutputElement extends CHTMLElement { - public el: HTMLOutputElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'output', - } as HTMLOutputElement; - } else { - this.el = document.createElement('output'); - } - } - - public defaultValue(value: string) { - this.el.defaultValue = value; - return this; - } - - public name(value: string) { - this.el.name = value; - return this; - } - - public value(value: string) { - this.el.value = value; - return this; - } -} - -export function output() { - return new CHTMLOutputElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLParagraphElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLParagraphElement.ts deleted file mode 100644 index bef6b7d..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLParagraphElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLParagraphElement extends CHTMLElement { - public el: HTMLParagraphElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'p', - } as HTMLParagraphElement; - } else { - this.el = document.createElement('p'); - } - } -} - -export function p() { - return new CHTMLParagraphElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLPictureElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLPictureElement.ts deleted file mode 100644 index 8970f1d..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLPictureElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLPictureElement extends CHTMLElement { - public el: HTMLPictureElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'picture', - } as HTMLPictureElement; - } else { - this.el = document.createElement('picture'); - } - } -} - -export function picture() { - return new CHTMLPictureElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLPreElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLPreElement.ts deleted file mode 100644 index 7a6ffde..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLPreElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLPreElement extends CHTMLElement { - public el: HTMLPreElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'pre', - } as HTMLPreElement; - } else { - this.el = document.createElement('pre'); - } - } -} - -export function pre() { - return new CHTMLPreElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLProgressElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLProgressElement.ts deleted file mode 100644 index 1dfb1fa..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLProgressElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLProgressElement extends CHTMLElement { - public el: HTMLProgressElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'progress', - } as HTMLProgressElement; - } else { - this.el = document.createElement('progress'); - } - } - - public max(value: number) { - this.el.max = value; - return this; - } - - public value(value: number) { - this.el.value = value; - return this; - } -} - -export function progress() { - return new CHTMLProgressElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLQuoteElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLQuoteElement.ts deleted file mode 100644 index 1ae2824..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLQuoteElement.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLQuoteElement extends CHTMLElement { - public el: HTMLQuoteElement; - - constructor(tag: 'blockquote' | 'q') { - super(); - if (isServer()) { - this.el = { - tagName: tag, - } as HTMLQuoteElement; - } else { - this.el = document.createElement(tag); - } - } - - public cite(cite: string) { - this.el.cite = cite; - return this; - } -} - -export function blockquote() { - return new CHTMLQuoteElement('blockquote'); -} - -export function q() { - return new CHTMLQuoteElement('q'); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLScriptElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLScriptElement.ts deleted file mode 100644 index c29bc25..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLScriptElement.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLScriptElement extends CHTMLElement { - public el: HTMLScriptElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'script', - } as HTMLScriptElement; - } else { - this.el = document.createElement('script'); - } - } - - public async(value: boolean) { - this.el.async = value; - return this; - } - - public defer(value: boolean) { - this.el.defer = value; - return this; - } - - public type(value: string) { - this.el.type = value; - return this; - } - - public src(value: string) { - this.el.src = value; - return this; - } - - public crossOrigin(value: string) { - this.el.crossOrigin = value; - return this; - } - - public text(value: string) { - this.el.text = value; - return this; - } - - public noModule(value: boolean) { - this.el.noModule = value; - return this; - } - - public referrerPolicy(value: string) { - this.el.referrerPolicy = value; - return this; - } -} - -export function script() { - return new CHTMLScriptElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLSelectElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLSelectElement.ts deleted file mode 100644 index 39bb574..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLSelectElement.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLSelectElement extends CHTMLElement { - public el: HTMLSelectElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'select', - } as HTMLSelectElement; - } else { - this.el = document.createElement('select'); - } - } - - public disabled(value: boolean) { - this.el.disabled = value; - return this; - } - - public length(value: number) { - this.el.length = value; - return this; - } - - public multiple(value: boolean) { - this.el.multiple = value; - return this; - } - - public name(value: string) { - this.el.name = value; - return this; - } - - public required(value: boolean) { - this.el.required = value; - return this; - } - - public selectedIndex(value: number) { - this.el.selectedIndex = value; - return this; - } - - public size(value: number) { - this.el.size = value; - return this; - } - - public value(value: string) { - this.el.value = value; - return this; - } -} - -export function select() { - return new CHTMLSelectElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLSlotElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLSlotElement.ts deleted file mode 100644 index 9c94f80..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLSlotElement.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLSlotElement extends CHTMLElement { - public el: HTMLSlotElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'slot', - } as HTMLSlotElement; - } else { - this.el = document.createElement('slot'); - } - } - - public name(value: string) { - this.el.name = value; - return this; - } -} - -export function slot() { - return new CHTMLSlotElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLSourceElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLSourceElement.ts deleted file mode 100644 index 248a1e6..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLSourceElement.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLSourceElement extends CHTMLElement { - public el: HTMLSourceElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'source', - } as HTMLSourceElement; - } else { - this.el = document.createElement('source'); - } - } - - public height(value: number) { - this.el.height = value; - return this; - } - - public media(value: string) { - this.el.media = value; - return this; - } - - public sizes(value: string) { - this.el.sizes = value; - return this; - } - - public src(value: string) { - this.el.src = value; - return this; - } - - public srcset(value: string) { - this.el.srcset = value; - return this; - } - - public type(value: string) { - this.el.type = value; - return this; - } - - public width(value: number) { - this.el.width = value; - return this; - } -} - -export function source() { - return new CHTMLSourceElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLSpanElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLSpanElement.ts deleted file mode 100644 index 1941acc..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLSpanElement.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLSpanElement extends CHTMLElement { - public el: HTMLSpanElement; - - constructor(tag: string = 'span') { - super(); - if (isServer()) { - this.el = { - tagName: tag, - } as HTMLSpanElement; - } else { - this.el = document.createElement(tag); - } - } -} - -export function span() { - return new CHTMLSpanElement(); -} - -export function address() { - return new CHTMLSpanElement('address'); -} - -export function dt() { - return new CHTMLSpanElement('dt'); -} - -export function bdo() { - return new CHTMLSpanElement('bdo'); -} - -export function cite() { - return new CHTMLSpanElement('cite'); -} - -export function code() { - return new CHTMLSpanElement('code'); -} - -export function em() { - return new CHTMLSpanElement('em'); -} - -export function i() { - return new CHTMLSpanElement('i'); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLStyleElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLStyleElement.ts deleted file mode 100644 index 97c8bd3..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLStyleElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLStyleElement extends CHTMLElement { - public el: HTMLStyleElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'style', - } as HTMLLinkElement; - } else { - this.el = document.createElement('style'); - } - } - - public media(value: string) { - this.el.media = value; - return this; - } - - public disabled(value: boolean) { - this.el.disabled = value; - return this; - } -} - -export function style() { - return new CHTMLStyleElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableCaptionElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTableCaptionElement.ts deleted file mode 100644 index 6482b25..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableCaptionElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTableCaptionElement extends CHTMLElement { - public el: HTMLTableCaptionElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'caption', - } as HTMLTableCaptionElement; - } else { - this.el = document.createElement('caption'); - } - } -} - -export function caption() { - return new CHTMLTableCaptionElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableCellElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTableCellElement.ts deleted file mode 100644 index b74a598..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableCellElement.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTableCellElement extends CHTMLElement { - public el: HTMLTableCellElement; - - constructor(tag: 'th' | 'td') { - super(); - if (isServer()) { - this.el = { - tagName: tag, - } as HTMLTableCellElement; - } else { - this.el = document.createElement(tag); - } - } - - public abbr(value: string) { - this.el.abbr = value; - return this; - } - - public colspan(value: number) { - this.el.colSpan = value; - return this; - } - - public rowspan(value: number) { - this.el.rowSpan = value; - return this; - } - - public scope(value: string) { - this.el.scope = value; - return this; - } -} - -export function td() { - return new CHTMLTableCellElement('td'); -} - -export function th() { - return new CHTMLTableCellElement('th'); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableColElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTableColElement.ts deleted file mode 100644 index 6fd10b6..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableColElement.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTableColElement extends CHTMLElement { - public el: HTMLTableColElement; - - constructor(tag: 'col' | 'colgroup') { - super(); - if (isServer()) { - this.el = { - tagName: tag, - } as HTMLTableColElement; - } else { - this.el = document.createElement(tag); - } - } - - public span(value: number) { - this.el.span = value; - return this; - } -} - -export function col() { - return new CHTMLTableColElement('col'); -} - -export function colgroup() { - return new CHTMLTableColElement('colgroup'); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTableElement.ts deleted file mode 100644 index 64aa7d1..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTableElement extends CHTMLElement { - public el: HTMLTableElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'table', - } as HTMLTableElement; - } else { - this.el = document.createElement('table'); - } - } -} - -export function table() { - return new CHTMLTableElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableRowElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTableRowElement.ts deleted file mode 100644 index 1bcf59d..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableRowElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTableRowElement extends CHTMLElement { - public el: HTMLTableRowElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'tr', - } as HTMLTableRowElement; - } else { - this.el = document.createElement('tr'); - } - } -} - -export function tr() { - return new CHTMLTableRowElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableSectionElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTableSectionElement.ts deleted file mode 100644 index 4853019..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTableSectionElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTableCaptionElement extends CHTMLElement { - public el: HTMLTableCaptionElement; - - constructor(tag: 'thead' | 'tbody' | 'tfoot') { - super(); - const html = document.createElement(tag); - this.el = html; - if (isServer()) { - this.el = { - tagName: tag, - } as HTMLTableCaptionElement; - } else { - this.el = document.createElement(tag); - } - } -} - -export function thead() { - return new CHTMLTableCaptionElement('thead'); -} - -export function tbody() { - return new CHTMLTableCaptionElement('tbody'); -} - -export function tfoot() { - return new CHTMLTableCaptionElement('tfoot'); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTemplateElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTemplateElement.ts deleted file mode 100644 index b70e280..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTemplateElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTemplateElement extends CHTMLElement { - public el: HTMLTemplateElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'template', - } as HTMLTemplateElement; - } else { - this.el = document.createElement('template'); - } - } -} - -export function template() { - return new CHTMLTemplateElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTextAreaElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTextAreaElement.ts deleted file mode 100644 index f7042ac..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTextAreaElement.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTextAreaElement extends CHTMLElement { - public el: HTMLTextAreaElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'textarea', - } as HTMLTextAreaElement; - } else { - this.el = document.createElement('textarea'); - } - } - - public autocapitalize(value: string) { - this.el.autocapitalize = value; - return this; - } - - public autocomplete(value: AutoFill) { - this.el.autocomplete = value; - return this; - } - - public cols(value: number) { - this.el.cols = value; - return this; - } - - public defaultValue(value: string) { - this.el.defaultValue = value; - return this; - } - - public dirName(value: string) { - this.el.dirName = value; - return this; - } - - public disabled(value: boolean) { - this.el.disabled = value; - return this; - } - - public maxLength(value: number) { - this.el.maxLength = value; - return this; - } - - public minLength(value: number) { - this.el.minLength = value; - return this; - } - - public name(value: string) { - this.el.name = value; - return this; - } - - public placeholder(value: string) { - this.el.placeholder = value; - return this; - } - - public readOnly(value: boolean) { - this.el.readOnly = value; - return this; - } - - public required(value: boolean) { - this.el.required = value; - return this; - } - - public rows(value: number) { - this.el.rows = value; - return this; - } - - public selectionDirection(value: 'forward' | 'backward' | 'none') { - this.el.selectionDirection = value; - return this; - } - - public selectionEnd(value: number) { - this.el.selectionEnd = value; - return this; - } - - public selectionStart(value: number) { - this.el.selectionStart = value; - return this; - } - - public textLength() { - return this.el.textLength; - } - - public value(value: string) { - this.el.value = value; - return this; - } - - public wrap(value: 'hard' | 'soft' | 'off') { - this.el.wrap = value; - return this; - } -} - -export function textarea() { - return new CHTMLTextAreaElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTimeElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTimeElement.ts deleted file mode 100644 index 8a619d1..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTimeElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTimeElement extends CHTMLElement { - public el: HTMLTimeElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'time', - } as HTMLTimeElement; - } else { - this.el = document.createElement('time'); - } - } -} - -export function time() { - return new CHTMLTimeElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTitleElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTitleElement.ts deleted file mode 100644 index 9ca2f59..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTitleElement.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTitleElement extends CHTMLElement { - public el: HTMLTitleElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'title', - } as HTMLTitleElement; - } else { - this.el = document.createElement('title'); - } - } - - public text(text: string) { - this.el.text = text; - return this; - } -} - -export function title() { - return new CHTMLTitleElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLTrackElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLTrackElement.ts deleted file mode 100644 index 49f4957..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLTrackElement.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLTrackElement extends CHTMLElement { - public el: HTMLTrackElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'track', - } as HTMLTrackElement; - } else { - this.el = document.createElement('track'); - } - } - - public kind(value: string) { - this.el.kind = value; - return this; - } - - public src(value: string) { - this.el.src = value; - return this; - } - - public srclang(value: string) { - this.el.srclang = value; - return this; - } - - public label(value: string) { - this.el.label = value; - return this; - } - - public default(value: boolean) { - this.el.default = value; - return this; - } -} - -export function track() { - return new CHTMLTrackElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLUListElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLUListElement.ts deleted file mode 100644 index 51fc7b9..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLUListElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLElement from './CHTMLElement'; - -class CHTMLUListElement extends CHTMLElement { - public el: HTMLUListElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'ul', - } as HTMLUListElement; - } else { - this.el = document.createElement('ul'); - } - } -} - -export function ul() { - return new CHTMLUListElement(); -} diff --git a/packages/sonnet-html/src/core/HtmlDom/CHTMLVideoElement.ts b/packages/sonnet-html/src/core/HtmlDom/CHTMLVideoElement.ts deleted file mode 100644 index 17b4b29..0000000 --- a/packages/sonnet-html/src/core/HtmlDom/CHTMLVideoElement.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CHTMLMediaElement from './CHTMLMediaElement'; - -class CHTMLVideoElement extends CHTMLMediaElement { - public el: HTMLVideoElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'video', - } as HTMLVideoElement; - } else { - this.el = document.createElement('video'); - } - } - - public disablePictureInPicture(value: boolean) { - this.el.disablePictureInPicture = value; - return this; - } - - public height(value: number) { - this.el.height = value; - return this; - } - - public poster(value: string) { - this.el.poster = value; - return this; - } - - public playsInline(value: boolean) { - this.el.playsInline = value; - return this; - } - - public width(value: number) { - this.el.width = value; - return this; - } -} - -export function video() { - return new CHTMLVideoElement(); -} diff --git a/packages/sonnet-html/src/index.ts b/packages/sonnet-html/src/index.ts deleted file mode 100644 index ccddb88..0000000 --- a/packages/sonnet-html/src/index.ts +++ /dev/null @@ -1,105 +0,0 @@ -export { a } from './core/HtmlDom/CHTMLAnchorElement'; -export { area } from './core/HtmlDom/CHTMLAreaElement'; -export { audio } from './core/HtmlDom/CHTMLAudioElement'; -export { base } from './core/HtmlDom/CHTMLBaseElement'; -export { body } from './core/HtmlDom/CHTMLBodyElement'; -export { br } from './core/HtmlDom/CHTMLBRElement'; -export { button } from './core/HtmlDom/CHTMLButtonElement'; -export { canvas } from './core/HtmlDom/CHTMLCanvasElement'; -export { data } from './core/HtmlDom/CHTMLDataElement'; -export { datalist } from './core/HtmlDom/CHTMLDataListElement'; -export { details } from './core/HtmlDom/CHTMLDetailsElement'; -export { dialog } from './core/HtmlDom/CHTMLDialogElement'; -export { div } from './core/HtmlDom/CHTMLDivElement'; -export { dl } from './core/HtmlDom/CHTMLDListElement'; -export { - article, - aside, - footer, - header, - hgroup, - main, - nav, - section, - search, - dd, - figcaption, - figure, - abbr, - b, - bdi, - dfn, - kbd, - mark, - rp, - rt, - ruby, - s, - samp, - small, - strong, - sub, - sup, - u, - variable, - wbr, - noscript, - summary, -} from './core/HtmlDom/CHTMLElement'; -export { embed } from './core/HtmlDom/CHTMLEmbedElement'; -export { fieldset } from './core/HtmlDom/CHTMLFieldSetElement'; -export { form } from './core/HtmlDom/CHTMLFormElement'; -export { head } from './core/HtmlDom/CHTMLHeadElement'; -export { h1, h2, h3, h4, h5, h6 } from './core/HtmlDom/CHTMLHeadingElement'; -export { hr } from './core/HtmlDom/CHTMLHRElement'; -export { html } from './core/HtmlDom/CHTMLHtmlElement'; -export { iframe } from './core/HtmlDom/CHTMLIFrameElement'; -export { img } from './core/HtmlDom/CHTMLImageElement'; -export { input } from './core/HtmlDom/CHTMLInputElement'; -export { label } from './core/HtmlDom/CHTMLLabelElement'; -export { legend } from './core/HtmlDom/CHTMLLegendElement'; -export { li } from './core/HtmlDom/CHTMLLiElement'; -export { link } from './core/HtmlDom/CHTMLLinkElement'; -export { map } from './core/HtmlDom/CHTMLMapElement'; -export { menu } from './core/HtmlDom/CHTMLMenuElement'; -export { meta } from './core/HtmlDom/CHTMLMetaElement'; -export { meter } from './core/HtmlDom/CHTMLMeterElement'; -export { del, ins } from './core/HtmlDom/CHTMLModElement'; -export { object } from './core/HtmlDom/CHTMLObjectElement'; -export { ol } from './core/HtmlDom/CHTMLOListElement'; -export { optgroup } from './core/HtmlDom/CHTMLOptGroupElement'; -export { option } from './core/HtmlDom/CHTMLOptionElement'; -export { output } from './core/HtmlDom/CHTMLOutputElement'; -export { p } from './core/HtmlDom/CHTMLParagraphElement'; -export { picture } from './core/HtmlDom/CHTMLPictureElement'; -export { pre } from './core/HtmlDom/CHTMLPreElement'; -export { progress } from './core/HtmlDom/CHTMLProgressElement'; -export { q, blockquote } from './core/HtmlDom/CHTMLQuoteElement'; -export { script } from './core/HtmlDom/CHTMLScriptElement'; -export { select } from './core/HtmlDom/CHTMLSelectElement'; -export { slot } from './core/HtmlDom/CHTMLSlotElement'; -export { source } from './core/HtmlDom/CHTMLSourceElement'; -export { style } from './core/HtmlDom/CHTMLStyleElement'; -export { - span, - address, - dt, - bdo, - cite, - code, - em, - i, -} from './core/HtmlDom/CHTMLSpanElement'; -export { caption } from './core/HtmlDom/CHTMLTableCaptionElement'; -export { td, th } from './core/HtmlDom/CHTMLTableCellElement'; -export { col, colgroup } from './core/HtmlDom/CHTMLTableColElement'; -export { table } from './core/HtmlDom/CHTMLTableElement'; -export { tr } from './core/HtmlDom/CHTMLTableRowElement'; -export { thead, tbody, tfoot } from './core/HtmlDom/CHTMLTableSectionElement'; -export { template } from './core/HtmlDom/CHTMLTemplateElement'; -export { textarea } from './core/HtmlDom/CHTMLTextAreaElement'; -export { time } from './core/HtmlDom/CHTMLTimeElement'; -export { title } from './core/HtmlDom/CHTMLTitleElement'; -export { track } from './core/HtmlDom/CHTMLTrackElement'; -export { ul } from './core/HtmlDom/CHTMLUListElement'; -export { video } from './core/HtmlDom/CHTMLVideoElement'; diff --git a/packages/sonnet-html/tsconfig.json b/packages/sonnet-html/tsconfig.json deleted file mode 100644 index 47044d8..0000000 --- a/packages/sonnet-html/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "@repo/typescript-config/base.json", - "include": ["."], - "exclude": ["node_modules", "dist", "build"] -} diff --git a/packages/sonnet-html/tsup.config.ts b/packages/sonnet-html/tsup.config.ts deleted file mode 100644 index 620b3c8..0000000 --- a/packages/sonnet-html/tsup.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig(() => ({ - entryPoints: ['src/index.ts'], - format: ['esm'], - dts: true, - sourcemap: false, - minify: true, -})); diff --git a/packages/sonnet-ml/.eslintrc.cjs b/packages/sonnet-ml/.eslintrc.cjs deleted file mode 100644 index 1ba520f..0000000 --- a/packages/sonnet-ml/.eslintrc.cjs +++ /dev/null @@ -1,10 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - ignorePatterns: [".eslintrc.cjs"], - extends: ["@repo/eslint-config/index.js"], - parser: "@typescript-eslint/parser", - parserOptions: { - project: true, - }, -}; diff --git a/packages/sonnet-ml/README.md b/packages/sonnet-ml/README.md deleted file mode 100644 index 0e11ca9..0000000 --- a/packages/sonnet-ml/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# sonnetjs/mathml - -sonnetjs/mathml is a library for creating MathML elements in JavaScript. It provides a set of functions to create MathML elements and provides chainable methods to set attributes, properties, and children. - -## Features - -- Create MathML elements using functions. -- Set attributes and properties of MathML elements using chainable methods. -- Add children to MathML elements using children method. - -## Usage - -1. Run the following command to create a new SonnetJS project. - -```bash -npx create-sonnet-app@latest -``` - -2. Change directory to the newly created project. - -```bash -cd [my-sonnet-app] -``` - -3. Install the dependencies - -```bash -npm i -``` - -4. Install sonnetjs/mathml - -```bash -npm i @sonnetjs/mathml -``` - -4. Start the development server - -```bash -npm run dev -``` - -## Documentation - -### MathML Elements - -You can create MathML elements using functions. - -```typescript -import { math, mrow, mi, mo } from '@sonnetjs/mathml'; - -const element = math() - .children( - mrow() - .children( - mi().innerText('x').get(), - mo().innerText('+').get(), - mi().innerText('y').get(), - ) - .get(), - ) - .get(); -``` - -## License - -sonnetjs/mathml is licensed under the MIT license. diff --git a/packages/sonnet-ml/package.json b/packages/sonnet-ml/package.json deleted file mode 100644 index e10b0b0..0000000 --- a/packages/sonnet-ml/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@sonnetjs/mathml", - "version": "0.0.8", - "files": [ - "dist" - ], - "module": "./dist/index.mjs", - "types": "./dist/index.d.mts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "types": "./dist/index.d.mts" - } - }, - "author": "htmujahid", - "license": "MIT", - "scripts": { - "build": "tsup", - "dev": "tsup --watch", - "lint": "eslint \"**/*.ts\"" - }, - "devDependencies": { - "@repo/eslint-config": "*", - "@repo/typescript-config": "*", - "eslint": "^8.57.0", - "tsup": "^8.0.2", - "typescript": "^5.3.3" - }, - "dependencies": { - "@sonnetjs/dom": "*", - "@sonnetjs/shared": "*" - }, - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sonnetjs/sonnet.git" - }, - "bugs": { - "url": "https://github.com/sonnetjs/sonnet/issues" - }, - "homepage": "https://github.com/sonnetjs/sonnet/tree/main/packages/sonnet-svg#readme", - "tags": [ - "sonnet", - "web-components", - "web" - ], - "keywords": [ - "sonnetjs", - "sonnet", - "web-components", - "components", - "web", - "frontend", - "sonnetml", - "mathml", - "math" - ] -} \ No newline at end of file diff --git a/packages/sonnet-ml/src/core/CMathMLElement.ts b/packages/sonnet-ml/src/core/CMathMLElement.ts deleted file mode 100644 index 9fbec4d..0000000 --- a/packages/sonnet-ml/src/core/CMathMLElement.ts +++ /dev/null @@ -1,191 +0,0 @@ -import { CElement } from '@sonnetjs/dom'; -export default class CMathMLElement extends CElement { - public el?: MathMLElement; - - constructor(tag: string) { - super(); - this.el = document.createElementNS( - 'http://www.w3.org/1998/Math/MathML', - tag, - ); - } - - public dir(value: string) { - if (this.el) { - this.el.setAttribute('dir', value); - } - return this; - } - - public style(value: CSSStyleDeclaration | Record) { - if (this.el) { - Object.assign(this.el.style, value); - } - return this; - } - - public displayStyle(value: string) { - if (this.el) { - this.el.setAttribute('display', value); - } - return this; - } - - public mathbackground(value: string) { - if (this.el) { - this.el.setAttribute('mathbackground', value); - } - return this; - } - - public mathcolor(value: string) { - if (this.el) { - this.el.setAttribute('mathcolor', value); - } - return this; - } - - public mathsize(value: string) { - if (this.el) { - this.el.setAttribute('mathsize', value); - } - return this; - } - - public nonce(value: string) { - if (this.el) { - this.el.setAttribute('nonce', value); - } - return this; - } - - public scriptlevel(value: string) { - if (this.el) { - this.el.setAttribute('scriptlevel', value); - } - return this; - } - - public tabindex(value: string) { - if (this.el) { - this.el.setAttribute('tabindex', value); - } - return this; - } -} - -export function math() { - return new CMathMLElement('math'); -} - -export function mi() { - return new CMathMLElement('mi'); -} - -export function mn() { - return new CMathMLElement('mn'); -} - -export function mo() { - return new CMathMLElement('mo'); -} - -export function ms() { - return new CMathMLElement('ms'); -} - -export function mspace() { - return new CMathMLElement('mspace'); -} - -export function mtext() { - return new CMathMLElement('mtext'); -} - -export function menclose() { - return new CMathMLElement('menclose'); -} - -export function merror() { - return new CMathMLElement('merror'); -} - -export function mfrac() { - return new CMathMLElement('mfrac'); -} - -export function mpadded() { - return new CMathMLElement('mpadded'); -} - -export function mphantom() { - return new CMathMLElement('mphantom'); -} - -export function mroot() { - return new CMathMLElement('mroot'); -} - -export function mrow() { - return new CMathMLElement('mrow'); -} - -export function msqrt() { - return new CMathMLElement('msqrt'); -} - -export function mstyle() { - return new CMathMLElement('mstyle'); -} - -export function mmultiscripts() { - return new CMathMLElement('mmultiscripts'); -} - -export function mover() { - return new CMathMLElement('mover'); -} - -export function msub() { - return new CMathMLElement('msub'); -} - -export function msubsup() { - return new CMathMLElement('msubsup'); -} - -export function msup() { - return new CMathMLElement('msup'); -} - -export function munder() { - return new CMathMLElement('munder'); -} - -export function munderover() { - return new CMathMLElement('munderover'); -} - -export function mtable() { - return new CMathMLElement('mtable'); -} - -export function mtr() { - return new CMathMLElement('mtr'); -} - -export function mtd() { - return new CMathMLElement('mtd'); -} - -export function annotation() { - return new CMathMLElement('annotation'); -} - -export function annotationXml() { - return new CMathMLElement('annotation-xml'); -} - -export function semantics() { - return new CMathMLElement('semantics'); -} diff --git a/packages/sonnet-ml/src/index.ts b/packages/sonnet-ml/src/index.ts deleted file mode 100644 index 4b5f16b..0000000 --- a/packages/sonnet-ml/src/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -export { - math, - menclose, - merror, - mfrac, - mi, - mmultiscripts, - mn, - mo, - mover, - mpadded, - mphantom, - mroot, - mrow, - ms, - mspace, - msqrt, - mstyle, - msub, - msubsup, - msup, - mtable, - mtd, - mtext, - mtr, - munder, - munderover, -} from './core/CMathMLElement'; diff --git a/packages/sonnet-ml/tsconfig.json b/packages/sonnet-ml/tsconfig.json deleted file mode 100644 index 47044d8..0000000 --- a/packages/sonnet-ml/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "@repo/typescript-config/base.json", - "include": ["."], - "exclude": ["node_modules", "dist", "build"] -} diff --git a/packages/sonnet-ml/tsup.config.ts b/packages/sonnet-ml/tsup.config.ts deleted file mode 100644 index 620b3c8..0000000 --- a/packages/sonnet-ml/tsup.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig(() => ({ - entryPoints: ['src/index.ts'], - format: ['esm'], - dts: true, - sourcemap: false, - minify: true, -})); diff --git a/packages/sonnet-svg/.eslintrc.cjs b/packages/sonnet-svg/.eslintrc.cjs deleted file mode 100644 index 1ba520f..0000000 --- a/packages/sonnet-svg/.eslintrc.cjs +++ /dev/null @@ -1,10 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - root: true, - ignorePatterns: [".eslintrc.cjs"], - extends: ["@repo/eslint-config/index.js"], - parser: "@typescript-eslint/parser", - parserOptions: { - project: true, - }, -}; diff --git a/packages/sonnet-svg/README.md b/packages/sonnet-svg/README.md deleted file mode 100644 index fe5c835..0000000 --- a/packages/sonnet-svg/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# sonnetjs/svg - -sonnetjs/svg is a library for creating SVG elements using a simple and declarative API. - -## Features - -- Create SVG elements using a simple and declarative API. -- Set attributes and properties of SVG elements using chainable methods. -- Add children to SVG elements using children method. - -## Usage - -1. Run the following command to create a new SonnetJS project. - -```bash -npx create-sonnet-app@latest -``` - -2. Change directory to the newly created project. - -```bash -cd [my-sonnet-app] -``` - -3. Install the dependencies - -```bash -npm i -``` - -4. Install sonnetjs/svg - -```bash -npm i @sonnetjs/svg -``` - -5. Start the development server - -```bash -npm run dev -``` - -## Documentation - -This is a simple example of how to use sonnetjs/svg to create an SVG element. - -```typescript -import { svg, rect } from '@sonnetjs/svg'; - -const element = svg() - .width(100) - .height(100) - .children(rect().x(10).y(10).width(80).height(80).fill('red')); -``` - -## License - -sonnetjs/svg is licensed under the MIT license. diff --git a/packages/sonnet-svg/package.json b/packages/sonnet-svg/package.json deleted file mode 100644 index 8316b8f..0000000 --- a/packages/sonnet-svg/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@sonnetjs/svg", - "version": "0.0.9", - "files": [ - "dist" - ], - "module": "./dist/index.mjs", - "types": "./dist/index.d.mts", - "exports": { - ".": { - "import": "./dist/index.mjs", - "types": "./dist/index.d.mts" - } - }, - "author": "htmujahid", - "license": "MIT", - "scripts": { - "build": "tsup", - "dev": "tsup --watch", - "lint": "eslint \"**/*.ts\"" - }, - "devDependencies": { - "@repo/eslint-config": "*", - "@repo/typescript-config": "*", - "eslint": "^8.57.0", - "tsup": "^8.0.2", - "typescript": "^5.3.3" - }, - "dependencies": { - "@sonnetjs/shared": "*", - "@sonnetjs/dom": "*" - }, - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sonnetjs/sonnet.git" - }, - "bugs": { - "url": "https://github.com/sonnetjs/sonnet/issues" - }, - "homepage": "https://github.com/sonnetjs/sonnet/tree/main/packages/sonnet-svg#readme", - "tags": [ - "sonnet", - "web-components", - "web", - "svg" - ], - "keywords": [ - "sonnetjs", - "sonnet", - "web-components", - "components", - "web", - "sonnet-svg", - "svg", - "frontend" - ] -} \ No newline at end of file diff --git a/packages/sonnet-svg/src/core/CSVGAElement.ts b/packages/sonnet-svg/src/core/CSVGAElement.ts deleted file mode 100644 index 40f2ff5..0000000 --- a/packages/sonnet-svg/src/core/CSVGAElement.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGAElement extends CSVGGraphicsElement { - public el?: SVGAElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'a', - } as SVGAElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'a'); - } - } - - public download(value: string) { - this.el?.setAttribute('download', value); - return this; - } - - public href(value: string) { - this.el?.setAttribute('href', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:href', - value, - ); - return this; - } - - public hrefLang(value: string) { - this.el?.setAttribute('hreflang', value); - return this; - } - - public ping(value: string) { - this.el?.setAttribute('ping', value); - return this; - } - - public referrerPolicy(value: string) { - this.el?.setAttribute('referrerpolicy', value); - return this; - } - - public rel(value: string) { - this.el?.setAttribute('rel', value); - return this; - } - - public target(value: string) { - this.el?.setAttribute('target', value); - return this; - } - - public type(value: string) { - this.el?.setAttribute('type', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:type', - value, - ); - return this; - } - - public actuate(value: string) { - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:actuate', - value, - ); - return this; - } - - public show(value: string) { - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:show', - value, - ); - return this; - } - - public title(value: string) { - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:title', - value, - ); - return this; - } - - public mask(value: string) { - this.el?.setAttribute('mask', value); - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function a() { - return new CSVGAElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGAnimateElement.ts b/packages/sonnet-svg/src/core/CSVGAnimateElement.ts deleted file mode 100644 index 6e0dfcf..0000000 --- a/packages/sonnet-svg/src/core/CSVGAnimateElement.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGAnimationElement from './CSVGAnimationElement'; - -export default class CSVGAnimateElement extends CSVGAnimationElement { - public el?: SVGAnimateElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'animate', - } as SVGAnimateElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'animate', - ); - } - } - - public animate(value: string) { - this.el?.setAttribute('animate', value); - return this; - } - - public attributeName(value: string) { - this.el?.setAttribute('attributeName', value); - return this; - } - - public attributeType(value: string) { - this.el?.setAttribute('attributeType', value); - return this; - } - - public dur(value: string) { - this.el?.setAttribute('dur', value); - return this; - } - - public repeatCount(value: string) { - this.el?.setAttribute('repeatCount', value); - return this; - } - - public href(value: string) { - this.el?.setAttribute('href', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:href', - value, - ); - return this; - } -} - -export function animate() { - return new CSVGAnimateElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGAnimateMotionElement.ts b/packages/sonnet-svg/src/core/CSVGAnimateMotionElement.ts deleted file mode 100644 index 3ec7053..0000000 --- a/packages/sonnet-svg/src/core/CSVGAnimateMotionElement.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGAnimationElement from './CSVGAnimationElement'; - -export default class CSVGAnimateMotionElement extends CSVGAnimationElement { - public el?: SVGAnimateMotionElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'animateMotion', - } as SVGAnimateMotionElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'animateMotion', - ); - } - } - - public calcMode(value: string) { - this.el?.setAttribute('calcMode', value); - return this; - } - - public origin(value: string) { - this.el?.setAttribute('origin', value); - return this; - } - - public path(value: string) { - this.el?.setAttribute('path', value); - return this; - } - - public rotate(value: string) { - this.el?.setAttribute('rotate', value); - return this; - } - - public href(value: string) { - this.el?.setAttribute('href', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:href', - value, - ); - return this; - } -} - -export function animateMotion() { - return new CSVGAnimateMotionElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGAnimateTransformElement.ts b/packages/sonnet-svg/src/core/CSVGAnimateTransformElement.ts deleted file mode 100644 index 1f4fcf2..0000000 --- a/packages/sonnet-svg/src/core/CSVGAnimateTransformElement.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGAnimationElement from './CSVGAnimationElement'; - -export default class CSVGAnimateElementTransform extends CSVGAnimationElement { - public el?: SVGAnimateTransformElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'animateTransform', - } as SVGAnimateTransformElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'animateTransform', - ); - } - } - - public attributeName(value: string) { - this.el?.setAttribute('attributeName', value); - return this; - } - - public attributeType(value: string) { - this.el?.setAttribute('attributeType', value); - return this; - } - - public type(value: string) { - this.el?.setAttribute('type', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:type', - value, - ); - return this; - } - - public dur(value: string) { - this.el?.setAttribute('dur', value); - return this; - } - - public repeatCount(value: string) { - this.el?.setAttribute('repeatCount', value); - return this; - } - - public href(value: string) { - this.el?.setAttribute('href', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:href', - value, - ); - return this; - } -} - -export function animateTransform() { - return new CSVGAnimateElementTransform(); -} diff --git a/packages/sonnet-svg/src/core/CSVGAnimationElement.ts b/packages/sonnet-svg/src/core/CSVGAnimationElement.ts deleted file mode 100644 index 70ea31c..0000000 --- a/packages/sonnet-svg/src/core/CSVGAnimationElement.ts +++ /dev/null @@ -1,99 +0,0 @@ -import CSVGElement from './CSVGElement'; - -export default class CSVGAnimationElement extends CSVGElement { - public declare el?: SVGAnimationElement; - - constructor() { - super(); - } - - public accumulate(value: string) { - this.el?.setAttribute('accumulate', value); - return this; - } - - public additive(value: string) { - this.el?.setAttribute('additive', value); - return this; - } - - public begin(value: string) { - this.el?.setAttribute('begin', value); - return this; - } - - public by(value: string) { - this.el?.setAttribute('by', value); - return this; - } - - public calcMode(value: string) { - this.el?.setAttribute('calcMode', value); - return this; - } - - public dur(value: string) { - this.el?.setAttribute('dur', value); - return this; - } - - public end(value: string) { - this.el?.setAttribute('end', value); - return this; - } - - public from(value: string) { - this.el?.setAttribute('from', value); - return this; - } - - public to(value: string) { - this.el?.setAttribute('to', value); - return this; - } - - public keySplines(value: string) { - this.el?.setAttribute('keySplines', value); - return this; - } - - public keyTimes(value: string) { - this.el?.setAttribute('keyTimes', value); - return this; - } - - public max(value: string) { - this.el?.setAttribute('max', value); - return this; - } - - public min(value: string) { - this.el?.setAttribute('min', value); - return this; - } - - public repeatCount(value: string) { - this.el?.setAttribute('repeatCount', value); - return this; - } - - public repeatDur(value: string) { - this.el?.setAttribute('repeatDur', value); - return this; - } - - public restart(value: string) { - this.el?.setAttribute('restart', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public values(value: string) { - this.el?.setAttribute('values', value); - return this; - } -} diff --git a/packages/sonnet-svg/src/core/CSVGCircleElement.ts b/packages/sonnet-svg/src/core/CSVGCircleElement.ts deleted file mode 100644 index ff6ee9e..0000000 --- a/packages/sonnet-svg/src/core/CSVGCircleElement.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGeometryElement from './CSVGGeometryElement'; - -export default class CSVGCircleElement extends CSVGGeometryElement { - public el?: SVGCircleElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'circle', - } as SVGCircleElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'circle', - ); - } - } - - public cx(value: string) { - this.el?.setAttribute('cx', value); - return this; - } - - public cy(value: string) { - this.el?.setAttribute('cy', value); - - return this; - } - - public r(value: string) { - this.el?.setAttribute('r', value); - - return this; - } - - public pathLength(value: string) { - this.el?.setAttribute('pathLength', value); - - return this; - } - - public mask(value: string) { - this.el?.setAttribute('mask', value); - - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function circle() { - return new CSVGCircleElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGClipPathElement.ts b/packages/sonnet-svg/src/core/CSVGClipPathElement.ts deleted file mode 100644 index 6090b33..0000000 --- a/packages/sonnet-svg/src/core/CSVGClipPathElement.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGClipPathElement extends CSVGElement { - public el?: SVGClipPathElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'clipPath', - } as SVGClipPathElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'clipPath', - ); - } - } - - public clipPathUnits(value: string) { - this.el?.setAttribute('clipPathUnits', value); - - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public mask(value: string) { - this.el?.setAttribute('mask', value); - - return this; - } -} - -export function clipPath() { - return new CSVGClipPathElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGComponentTransferFunctionElement.ts b/packages/sonnet-svg/src/core/CSVGComponentTransferFunctionElement.ts deleted file mode 100644 index df8cf95..0000000 --- a/packages/sonnet-svg/src/core/CSVGComponentTransferFunctionElement.ts +++ /dev/null @@ -1,41 +0,0 @@ -import CSVGElement from './CSVGElement'; - -export default class CSVGComponentTransferFunctionElement< - T, -> extends CSVGElement { - public declare el?: SVGComponentTransferFunctionElement; - - constructor() { - super(); - } - - public amplitude(value: string) { - this.el?.setAttribute('amplitude', value); - return this; - } - - public exponent(value: string) { - this.el?.setAttribute('exponent', value); - return this; - } - - public intercept(value: string) { - this.el?.setAttribute('intercept', value); - return this; - } - - public tableValues(value: string) { - this.el?.setAttribute('tableValues', value); - return this; - } - - public type(value: string) { - this.el?.setAttribute('type', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:type', - value, - ); - return this; - } -} diff --git a/packages/sonnet-svg/src/core/CSVGDefsElement.ts b/packages/sonnet-svg/src/core/CSVGDefsElement.ts deleted file mode 100644 index c62b2af..0000000 --- a/packages/sonnet-svg/src/core/CSVGDefsElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGDefsElement extends CSVGGraphicsElement { - public el?: SVGDefsElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'defs', - } as SVGDefsElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'defs'); - } - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } -} - -export function defs() { - return new CSVGDefsElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGDescElement.ts b/packages/sonnet-svg/src/core/CSVGDescElement.ts deleted file mode 100644 index 05104f6..0000000 --- a/packages/sonnet-svg/src/core/CSVGDescElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGAElemenDesc extends CSVGElement { - public el?: SVGDescElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'desc', - } as SVGDescElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'desc'); - } - } -} - -export function desc() { - return new CSVGAElemenDesc(); -} diff --git a/packages/sonnet-svg/src/core/CSVGElement.ts b/packages/sonnet-svg/src/core/CSVGElement.ts deleted file mode 100644 index 866d353..0000000 --- a/packages/sonnet-svg/src/core/CSVGElement.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { CElement } from '@sonnetjs/dom'; -export default class CSVGElement extends CElement { - public declare el?: SVGElement; - - constructor() { - super(); - } - - public nonce(value: string) { - if (this.el) { - this.el.nonce = value; - } - return this; - } - - public style(value: CSSStyleDeclaration | Record) { - if (this.el) { - // this.el.style.cssText = value; - Object.assign(this.el.style, value); - } - return this; - } - - public tabIndex(value: number) { - if (this.el) { - this.el.tabIndex = value; - } - return this; - } - - public color(value: string) { - this.el?.setAttribute('color', value); - - return this; - } - - public cursor(value: string) { - this.el?.setAttribute('cursor', value); - - return this; - } - - public display(value: string) { - this.el?.setAttribute('display', value); - - return this; - } - - public filter(value: string) { - this.el?.setAttribute('filter', value); - - return this; - } - - public transform(value: string) { - this.el?.setAttribute('transform', value); - - return this; - } - - public transformOriging(value: string) { - this.el?.setAttribute('transform-origin', value); - - return this; - } -} diff --git a/packages/sonnet-svg/src/core/CSVGEllipseElement.ts b/packages/sonnet-svg/src/core/CSVGEllipseElement.ts deleted file mode 100644 index d238408..0000000 --- a/packages/sonnet-svg/src/core/CSVGEllipseElement.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGeometryElement from './CSVGGeometryElement'; - -export default class CSVGEllipseElement extends CSVGGeometryElement { - public el?: SVGEllipseElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'ellipse', - } as SVGEllipseElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'ellipse', - ); - } - } - - public cx(value: string) { - this.el?.setAttribute('cx', value); - return this; - } - - public cy(value: string) { - this.el?.setAttribute('cy', value); - return this; - } - - public rx(value: string) { - this.el?.setAttribute('rx', value); - return this; - } - - public ry(value: string) { - this.el?.setAttribute('ry', value); - return this; - } - - public pathLength(value: string) { - this.el?.setAttribute('pathLength', value); - return this; - } - - public mask(value: string) { - this.el?.setAttribute('mask', value); - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function ellipse() { - return new CSVGEllipseElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEBlendElement.ts b/packages/sonnet-svg/src/core/CSVGFEBlendElement.ts deleted file mode 100644 index b481d60..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEBlendElement.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEBlendElement extends CSVGElement { - public el?: SVGFEBlendElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feBlend', - } as SVGFEBlendElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feBlend', - ); - } - } - - public in(value: string) { - this.el?.setAttribute('in', value); - return this; - } - - public in2(value: string) { - this.el?.setAttribute('in2', value); - return this; - } - - public mode(value: string) { - this.el?.setAttribute('mode', value); - return this; - } - - public colorInterpolationFilters(value: string) { - this.el?.setAttribute('color-interpolation-filters', value); - return this; - } - - public height(value: string) { - this.el?.setAttribute('height', value); - return this; - } - - public result(value: string) { - this.el?.setAttribute('result', value); - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feBlend() { - return new CSVGFEBlendElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEColorMatrixElement.ts b/packages/sonnet-svg/src/core/CSVGFEColorMatrixElement.ts deleted file mode 100644 index a525edb..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEColorMatrixElement.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEColorMatrixElement extends CSVGElement { - public el?: SVGFEColorMatrixElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feColorMatrix', - } as SVGFEColorMatrixElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feColorMatrix', - ); - } - } - - public in(value: string) { - this.el?.setAttribute('in', value); - return this; - } - - public type(value: string) { - this.el?.setAttribute('type', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:type', - value, - ); - return this; - } - - public values(value: string) { - this.el?.setAttribute('values', value); - return this; - } - - public colorInterpolationFilters(value: string) { - this.el?.setAttribute('color-interpolation-filters', value); - return this; - } - - public height(value: string) { - this.el?.setAttribute('height', value); - return this; - } - - public result(value: string) { - this.el?.setAttribute('result', value); - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feColorMatrix() { - return new CSVGFEColorMatrixElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEComponentTransferElement.ts b/packages/sonnet-svg/src/core/CSVGFEComponentTransferElement.ts deleted file mode 100644 index eac551e..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEComponentTransferElement.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEComponentTransferElement extends CSVGElement { - public el?: SVGFEComponentTransferElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feComponentTransfer', - } as SVGFEComponentTransferElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feComponentTransfer', - ); - } - } - - public in(value: string) { - this.el?.setAttribute('in', value); - return this; - } - - public height(value: string) { - this.el?.setAttribute('height', value); - return this; - } - - public colorInterpolationFilters(value: string) { - this.el?.setAttribute('color-interpolation-filters', value); - return this; - } - - public result(value: string) { - this.el?.setAttribute('result', value); - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feComponentTransfer() { - return new CSVGFEComponentTransferElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFECompositeElement.ts b/packages/sonnet-svg/src/core/CSVGFECompositeElement.ts deleted file mode 100644 index 7ebb260..0000000 --- a/packages/sonnet-svg/src/core/CSVGFECompositeElement.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFECompositeElement extends CSVGElement { - public el?: SVGFECompositeElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feComposite', - } as SVGFECompositeElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feComposite', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } - - public in2(value: string) { - if (this.el) { - this.el.setAttribute('in2', value); - } - return this; - } - - public operator(value: string) { - if (this.el) { - this.el.setAttribute('operator', value); - } - return this; - } - - public k1(value: string) { - if (this.el) { - this.el.setAttribute('k1', value); - } - return this; - } - - public k2(value: string) { - if (this.el) { - this.el.setAttribute('k2', value); - } - return this; - } - - public k3(value: string) { - if (this.el) { - this.el.setAttribute('k3', value); - } - return this; - } - - public k4(value: string) { - if (this.el) { - this.el.setAttribute('k4', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } -} - -export function feComposite() { - return new CSVGFECompositeElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEConvolveMatrixElement.ts b/packages/sonnet-svg/src/core/CSVGFEConvolveMatrixElement.ts deleted file mode 100644 index dfd6809..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEConvolveMatrixElement.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEConvolveMatrixElement extends CSVGElement { - public el?: SVGFEConvolveMatrixElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feConvolveMatrix', - } as SVGFEConvolveMatrixElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feConvolveMatrix', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } - - public order(value: string) { - if (this.el) { - this.el.setAttribute('order', value); - } - return this; - } - - public kernelMatrix(value: string) { - if (this.el) { - this.el.setAttribute('kernelMatrix', value); - } - return this; - } - - public divisor(value: string) { - if (this.el) { - this.el.setAttribute('divisor', value); - } - return this; - } - - public bias(value: string) { - if (this.el) { - this.el.setAttribute('bias', value); - } - return this; - } - - public targetX(value: string) { - if (this.el) { - this.el.setAttribute('targetX', value); - } - return this; - } - - public targetY(value: string) { - if (this.el) { - this.el.setAttribute('targetY', value); - } - return this; - } - - public edgeMode(value: string) { - if (this.el) { - this.el.setAttribute('edgeMode', value); - } - return this; - } - - public kernelUnitLength(value: string) { - if (this.el) { - this.el.setAttribute('kernelUnitLength', value); - } - return this; - } - - public preserveAlpha(value: string) { - if (this.el) { - this.el.setAttribute('preserveAlpha', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } -} - -export function feConvolveMatrix() { - return new CSVGFEConvolveMatrixElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEDiffuseLightingElement.ts b/packages/sonnet-svg/src/core/CSVGFEDiffuseLightingElement.ts deleted file mode 100644 index 3674e72..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEDiffuseLightingElement.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEDiffuseLightingElement extends CSVGElement { - public el?: SVGFEDiffuseLightingElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feDiffuseLighting', - } as SVGFEDiffuseLightingElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feDiffuseLighting', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } - - public surfaceScale(value: string) { - if (this.el) { - this.el.setAttribute('surfaceScale', value); - } - return this; - } - - public diffuseConstant(value: string) { - if (this.el) { - this.el.setAttribute('diffuseConstant', value); - } - return this; - } - - public kernelUnitLength(value: string) { - if (this.el) { - this.el.setAttribute('kernelUnitLength', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feDiffuseLighting() { - return new CSVGFEDiffuseLightingElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEDisplacementMapElement.ts b/packages/sonnet-svg/src/core/CSVGFEDisplacementMapElement.ts deleted file mode 100644 index afa99b5..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEDisplacementMapElement.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEDisplacementMapElement extends CSVGElement { - public el?: SVGFEDisplacementMapElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feDisplacementMap', - } as SVGFEDisplacementMapElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feDisplacementMap', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } - - public in2(value: string) { - if (this.el) { - this.el.setAttribute('in2', value); - } - return this; - } - - public scale(value: string) { - if (this.el) { - this.el.setAttribute('scale', value); - } - return this; - } - - public xChannelSelector(value: string) { - if (this.el) { - this.el.setAttribute('xChannelSelector', value); - } - return this; - } - - public yChannelSelector(value: string) { - if (this.el) { - this.el.setAttribute('yChannelSelector', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feDisplacementMap() { - return new CSVGFEDisplacementMapElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEDistantLightElement.ts b/packages/sonnet-svg/src/core/CSVGFEDistantLightElement.ts deleted file mode 100644 index 36995b6..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEDistantLightElement.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEDistantLightElement extends CSVGElement { - public el?: SVGFEDistantLightElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feDistantLight', - } as SVGFEDistantLightElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feDistantLight', - ); - } - } - - public azimuth(value: string) { - if (this.el) { - this.el.setAttribute('azimuth', value); - } - return this; - } - - public elevation(value: string) { - if (this.el) { - this.el.setAttribute('elevation', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } -} - -export function feDistantLight() { - return new CSVGFEDistantLightElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEDropShadowElement.ts b/packages/sonnet-svg/src/core/CSVGFEDropShadowElement.ts deleted file mode 100644 index 449712a..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEDropShadowElement.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEDropShadowElement extends CSVGElement { - public el?: SVGFEDropShadowElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feDropShadow', - } as SVGFEDropShadowElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feDropShadow', - ); - } - } - - public dx(value: string) { - if (this.el) { - this.el.setAttribute('dx', value); - } - return this; - } - - public dy(value: string) { - if (this.el) { - this.el.setAttribute('dy', value); - } - return this; - } - - public stdDeviation(value: string) { - if (this.el) { - this.el.setAttribute('stdDeviation', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public floodColor(value: string) { - if (this.el) { - this.el.setAttribute('flood-color', value); - } - return this; - } - - public floodOpacity(value: string) { - if (this.el) { - this.el.setAttribute('flood-opacity', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feDropShadow() { - return new CSVGFEDropShadowElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEFloodElement.ts b/packages/sonnet-svg/src/core/CSVGFEFloodElement.ts deleted file mode 100644 index 261981d..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEFloodElement.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEFloodElement extends CSVGElement { - public el?: SVGFEFloodElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feFlood', - } as SVGFEFloodElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feFlood', - ); - } - } - - public floodColor(value: string) { - if (this.el) { - this.el.setAttribute('flood-color', value); - } - return this; - } - - public floodOpacity(value: string) { - if (this.el) { - this.el.setAttribute('flood-opacity', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feFlood() { - return new CSVGFEFloodElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEFuncAElement.ts b/packages/sonnet-svg/src/core/CSVGFEFuncAElement.ts deleted file mode 100644 index af3285a..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEFuncAElement.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGComponentTransferFunctionElement from './CSVGComponentTransferFunctionElement'; - -export default class CSVGFEFuncAElement extends CSVGComponentTransferFunctionElement { - public el?: SVGFEFuncAElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feFuncA', - } as SVGFEFuncAElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feFuncA', - ); - } - } -} - -export function feFuncA() { - return new CSVGFEFuncAElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEFuncBElement.ts b/packages/sonnet-svg/src/core/CSVGFEFuncBElement.ts deleted file mode 100644 index 2af26e6..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEFuncBElement.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGComponentTransferFunctionElement from './CSVGComponentTransferFunctionElement'; - -export default class CSVGFEFuncBElement extends CSVGComponentTransferFunctionElement { - public el?: SVGFEFuncBElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feFuncB', - } as SVGFEFuncBElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feFuncB', - ); - } - } -} - -export function feFuncB() { - return new CSVGFEFuncBElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEFuncGElement.ts b/packages/sonnet-svg/src/core/CSVGFEFuncGElement.ts deleted file mode 100644 index 194a2dc..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEFuncGElement.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGComponentTransferFunctionElement from './CSVGComponentTransferFunctionElement'; - -export default class CSVGFEFuncBElement extends CSVGComponentTransferFunctionElement { - public el?: SVGFEFuncBElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feFuncB', - } as SVGFEFuncBElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feFuncB', - ); - } - } -} - -export function feFuncG() { - return new CSVGFEFuncBElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEFuncRElement.ts b/packages/sonnet-svg/src/core/CSVGFEFuncRElement.ts deleted file mode 100644 index 47165aa..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEFuncRElement.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGComponentTransferFunctionElement from './CSVGComponentTransferFunctionElement'; - -export default class CSVGFEFuncRElement extends CSVGComponentTransferFunctionElement { - public el?: SVGFEFuncRElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feFuncR', - } as SVGFEFuncRElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feFuncR', - ); - } - } -} - -export function feFuncR() { - return new CSVGFEFuncRElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEGaussianBlurElement.ts b/packages/sonnet-svg/src/core/CSVGFEGaussianBlurElement.ts deleted file mode 100644 index b4b6d1a..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEGaussianBlurElement.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEGaussianBlurElement extends CSVGElement { - public el?: SVGFEGaussianBlurElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feGaussianBlur', - } as SVGFEGaussianBlurElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feGaussianBlur', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } - - public stdDeviation(value: string) { - if (this.el) { - this.el.setAttribute('stdDeviation', value); - } - return this; - } - - public edgeMode(value: string) { - if (this.el) { - this.el.setAttribute('edgeMode', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feGaussianBlur() { - return new CSVGFEGaussianBlurElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEImageElement.ts b/packages/sonnet-svg/src/core/CSVGFEImageElement.ts deleted file mode 100644 index 5589740..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEImageElement.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEImageElement extends CSVGElement { - public el?: SVGFEImageElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feImage', - } as SVGFEImageElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feImage', - ); - } - } - - public crossOrigin(value: string) { - if (this.el) { - this.el.setAttribute('crossOrigin', value); - } - return this; - } - - public href(value: string) { - if (this.el) { - this.el.setAttribute('href', value); - this.el.setAttributeNS('http://www.w3.org/1999/xlink', 'href', value); - } - return this; - } - - public preserveAspectRatio(value: string) { - if (this.el) { - this.el.setAttribute('preserveAspectRatio', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feImage() { - return new CSVGFEImageElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEMergeElement.ts b/packages/sonnet-svg/src/core/CSVGFEMergeElement.ts deleted file mode 100644 index 8c826f4..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEMergeElement.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEMergeElement extends CSVGElement { - public el?: SVGFEMergeElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feMerge', - } as SVGFEMergeElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feMerge', - ); - } - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feMerge() { - return new CSVGFEMergeElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEMergeNodeElement.ts b/packages/sonnet-svg/src/core/CSVGFEMergeNodeElement.ts deleted file mode 100644 index cd9bb88..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEMergeNodeElement.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEMergeNodeElement extends CSVGElement { - public el?: SVGFEMergeNodeElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feMergeNode', - } as SVGFEMergeNodeElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feMergeNode', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } -} - -export function feMergeNode() { - return new CSVGFEMergeNodeElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEMorphologyElement.ts b/packages/sonnet-svg/src/core/CSVGFEMorphologyElement.ts deleted file mode 100644 index 60649b2..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEMorphologyElement.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEMorphologyElement extends CSVGElement { - public el?: SVGFEMorphologyElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feMorphology', - } as SVGFEMorphologyElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feMorphology', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } - - public operator(value: string) { - if (this.el) { - this.el.setAttribute('operator', value); - } - return this; - } - - public radius(value: string) { - if (this.el) { - this.el.setAttribute('radius', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feMorphology() { - return new CSVGFEMorphologyElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEOffsetElement.ts b/packages/sonnet-svg/src/core/CSVGFEOffsetElement.ts deleted file mode 100644 index cb97761..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEOffsetElement.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEOffsetElement extends CSVGElement { - public el?: SVGFEOffsetElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feOffset', - } as SVGFEOffsetElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feOffset', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } - - public dx(value: string) { - if (this.el) { - this.el.setAttribute('dx', value); - } - return this; - } - - public dy(value: string) { - if (this.el) { - this.el.setAttribute('dy', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feOffset() { - return new CSVGFEOffsetElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFEPointLightElement.ts b/packages/sonnet-svg/src/core/CSVGFEPointLightElement.ts deleted file mode 100644 index 47c7660..0000000 --- a/packages/sonnet-svg/src/core/CSVGFEPointLightElement.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFEPointLightElement extends CSVGElement { - public el?: SVGFEPointLightElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'fePointLight', - } as SVGFEPointLightElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'fePointLight', - ); - } - } - - public x(value: string) { - if (this.el) { - this.el.setAttribute('x', value); - } - return this; - } - - public y(value: string) { - if (this.el) { - this.el.setAttribute('y', value); - } - return this; - } - - public z(value: string) { - if (this.el) { - this.el.setAttribute('z', value); - } - return this; - } -} - -export function fePointLight() { - return new CSVGFEPointLightElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFESpecularLightingElement.ts b/packages/sonnet-svg/src/core/CSVGFESpecularLightingElement.ts deleted file mode 100644 index a801a86..0000000 --- a/packages/sonnet-svg/src/core/CSVGFESpecularLightingElement.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFESpecularLightingElement extends CSVGElement { - public el?: SVGFESpecularLightingElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feSpecularLighting', - } as SVGFESpecularLightingElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feSpecularLighting', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } - - public surfaceScale(value: string) { - if (this.el) { - this.el.setAttribute('surfaceScale', value); - } - return this; - } - - public specularConstant(value: string) { - if (this.el) { - this.el.setAttribute('specularConstant', value); - } - return this; - } - - public specularExponent(value: string) { - if (this.el) { - this.el.setAttribute('specularExponent', value); - } - return this; - } - - public kernelUnitLength(value: string) { - if (this.el) { - this.el.setAttribute('kernelUnitLength', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public lightingColor(value: string) { - if (this.el) { - this.el.setAttribute('lighting-color', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feSpecularLighting() { - return new CSVGFESpecularLightingElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFESpotLightElement.ts b/packages/sonnet-svg/src/core/CSVGFESpotLightElement.ts deleted file mode 100644 index 575987f..0000000 --- a/packages/sonnet-svg/src/core/CSVGFESpotLightElement.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFESpotLightElement extends CSVGElement { - public el?: SVGFESpotLightElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feSpotLight', - } as SVGFESpotLightElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feSpotLight', - ); - } - } - - public x(value: string) { - if (this.el) { - this.el.setAttribute('x', value); - } - return this; - } - - public y(value: string) { - if (this.el) { - this.el.setAttribute('y', value); - } - return this; - } - - public z(value: string) { - if (this.el) { - this.el.setAttribute('z', value); - } - return this; - } - - public pointsAtX(value: string) { - if (this.el) { - this.el.setAttribute('pointsAtX', value); - } - return this; - } - - public pointsAtY(value: string) { - if (this.el) { - this.el.setAttribute('pointsAtY', value); - } - return this; - } - - public pointsAtZ(value: string) { - if (this.el) { - this.el.setAttribute('pointsAtZ', value); - } - return this; - } - - public specularExponent(value: string) { - if (this.el) { - this.el.setAttribute('specularExponent', value); - } - return this; - } - - public limitingConeAngle(value: string) { - if (this.el) { - this.el.setAttribute('limitingConeAngle', value); - } - return this; - } -} - -export function feSpotLight() { - return new CSVGFESpotLightElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFETileElement.ts b/packages/sonnet-svg/src/core/CSVGFETileElement.ts deleted file mode 100644 index bc1303a..0000000 --- a/packages/sonnet-svg/src/core/CSVGFETileElement.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFETileElement extends CSVGElement { - public el?: SVGFETileElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feTile', - } as SVGFETileElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feTile', - ); - } - } - - public in(value: string) { - if (this.el) { - this.el.setAttribute('in', value); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } -} - -export function feTile() { - return new CSVGFETileElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFETurbulenceElement.ts b/packages/sonnet-svg/src/core/CSVGFETurbulenceElement.ts deleted file mode 100644 index 8845291..0000000 --- a/packages/sonnet-svg/src/core/CSVGFETurbulenceElement.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFETurbulenceElement extends CSVGElement { - public el?: SVGFETurbulenceElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'feTurbulence', - } as SVGFETurbulenceElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'feTurbulence', - ); - } - } - - public baseFrequency(value: string) { - if (this.el) { - this.el.setAttribute('baseFrequency', value); - } - return this; - } - - public numOctaves(value: string) { - if (this.el) { - this.el.setAttribute('numOctaves', value); - } - return this; - } - - public seed(value: string) { - if (this.el) { - this.el.setAttribute('seed', value); - } - return this; - } - - public stitchTiles(value: string) { - if (this.el) { - this.el.setAttribute('stitchTiles', value); - } - return this; - } - - public type(value: string) { - if (this.el) { - this.el.setAttribute('type', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:type', - value, - ); - } - return this; - } - - public colorInterpolationFilters(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation-filters', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } - - public result(value: string) { - if (this.el) { - this.el.setAttribute('result', value); - } - return this; - } -} - -export function feTurbulence() { - return new CSVGFETurbulenceElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGFilterElement.ts b/packages/sonnet-svg/src/core/CSVGFilterElement.ts deleted file mode 100644 index 46be668..0000000 --- a/packages/sonnet-svg/src/core/CSVGFilterElement.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGFilterElement extends CSVGElement { - public el?: SVGFilterElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'filter', - } as SVGFilterElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'filter', - ); - } - } - - public x(value: string) { - if (this.el) { - this.el.setAttribute('x', value); - } - return this; - } - - public y(value: string) { - if (this.el) { - this.el.setAttribute('y', value); - } - return this; - } - - public width(value: string) { - if (this.el) { - this.el.setAttribute('width', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public filterUnits(value: string) { - if (this.el) { - this.el.setAttribute('filterUnits', value); - } - return this; - } - - public primitiveUnits(value: string) { - if (this.el) { - this.el.setAttribute('primitiveUnits', value); - } - return this; - } - - public href(value: string) { - if (this.el) { - this.el.setAttribute('href', value); - this.el.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:href', - value, - ); - } - return this; - } -} - -export function filter() { - return new CSVGFilterElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGForeignObjectElement.ts b/packages/sonnet-svg/src/core/CSVGForeignObjectElement.ts deleted file mode 100644 index 840ae17..0000000 --- a/packages/sonnet-svg/src/core/CSVGForeignObjectElement.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGForeignObjectElement extends CSVGGraphicsElement { - public el?: SVGForeignObjectElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'foreignObject', - } as SVGForeignObjectElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'foreignObject', - ); - } - } - - public x(value: string) { - if (this.el) { - this.el.setAttribute('x', value); - } - return this; - } - - public y(value: string) { - if (this.el) { - this.el.setAttribute('y', value); - } - return this; - } - - public width(value: string) { - if (this.el) { - this.el.setAttribute('width', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public overflow(value: string) { - this.el?.setAttribute('overflow', value); - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public vectorOffset(value: string) { - if (this.el) { - this.el.setAttribute('vector-offset', value); - } - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function foreignObject() { - return new CSVGForeignObjectElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGGElement.ts b/packages/sonnet-svg/src/core/CSVGGElement.ts deleted file mode 100644 index 5a98bbc..0000000 --- a/packages/sonnet-svg/src/core/CSVGGElement.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGGElement extends CSVGGraphicsElement { - public el?: SVGGElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'g', - } as SVGGElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'g'); - } - } - - public fill(color: string) { - if (this.el) { - this.el.setAttribute('fill', color); - } - return this; - } - - public stroke(color: string) { - if (this.el) { - this.el.setAttribute('stroke', color); - } - return this; - } - - public strokeWidth(width: number) { - if (this.el) { - this.el.setAttribute('stroke-width', width.toString()); - } - return this; - } - - public mask(value: string) { - if (this.el) { - this.el.setAttribute('mask', value); - } - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } -} - -export function g() { - return new CSVGGElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGGeometryElement.ts b/packages/sonnet-svg/src/core/CSVGGeometryElement.ts deleted file mode 100644 index 37655c9..0000000 --- a/packages/sonnet-svg/src/core/CSVGGeometryElement.ts +++ /dev/null @@ -1,128 +0,0 @@ -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGGeometryElement extends CSVGGraphicsElement { - public declare el?: SVGGeometryElement; - - constructor() { - super(); - } - - public fill(value: string) { - if (this.el) { - this.el.setAttribute('fill', value); - } - return this; - } - - public fillOpacity(value: string) { - if (this.el) { - this.el.setAttribute('fill-opacity', value); - } - return this; - } - - public markerEnd(value: string) { - if (this.el) { - this.el.setAttribute('marker-end', value); - } - return this; - } - - public markerMid(value: string) { - if (this.el) { - this.el.setAttribute('marker-mid', value); - } - return this; - } - - public markerStart(value: string) { - if (this.el) { - this.el.setAttribute('marker-start', value); - } - return this; - } - - public paintOrder(value: string) { - if (this.el) { - this.el.setAttribute('paint-order', value); - } - return this; - } - - public pathLength(value: string) { - if (this.el) { - this.el.setAttribute('pathLength', value); - } - return this; - } - - public shapeRendering(value: string) { - if (this.el) { - this.el.setAttribute('shape-rendering', value); - } - return this; - } - - public stroke(value: string) { - if (this.el) { - this.el.setAttribute('stroke', value); - } - return this; - } - - public strokeDasharray(value: string) { - if (this.el) { - this.el.setAttribute('stroke-dasharray', value); - } - return this; - } - - public strokeDashoffset(value: string) { - if (this.el) { - this.el.setAttribute('stroke-dashoffset', value); - } - return this; - } - - public strokeLinecap(value: string) { - if (this.el) { - this.el.setAttribute('stroke-linecap', value); - } - return this; - } - - public strokeLinejoin(value: string) { - if (this.el) { - this.el.setAttribute('stroke-linejoin', value); - } - return this; - } - - public strokeMiterlimit(value: string) { - if (this.el) { - this.el.setAttribute('stroke-miterlimit', value); - } - return this; - } - - public strokeOpacity(value: string) { - if (this.el) { - this.el.setAttribute('stroke-opacity', value); - } - return this; - } - - public strokeWidth(value: string) { - if (this.el) { - this.el.setAttribute('stroke-width', value); - } - return this; - } - - public vectorOffset(value: string) { - if (this.el) { - this.el.setAttribute('vector-offset', value); - } - return this; - } -} diff --git a/packages/sonnet-svg/src/core/CSVGGradientElement.ts b/packages/sonnet-svg/src/core/CSVGGradientElement.ts deleted file mode 100644 index a3feac4..0000000 --- a/packages/sonnet-svg/src/core/CSVGGradientElement.ts +++ /dev/null @@ -1,30 +0,0 @@ -import CSVGElement from './CSVGElement'; - -export default class CSVGGradientElement extends CSVGElement { - declare public el?: SVGGradientElement; - - constructor() { - super(); - } - - public gradientUnits(value: string) { - if (this.el) { - this.el.setAttribute('gradientUnits', value); - } - return this; - } - - public gradientTransform(value: string) { - if (this.el) { - this.el.setAttribute('gradientTransform', value); - } - return this; - } - - public spreadMethod(value: string) { - if (this.el) { - this.el.setAttribute('spreadMethod', value); - } - return this; - } -} diff --git a/packages/sonnet-svg/src/core/CSVGGraphicsElement.ts b/packages/sonnet-svg/src/core/CSVGGraphicsElement.ts deleted file mode 100644 index 8a1b700..0000000 --- a/packages/sonnet-svg/src/core/CSVGGraphicsElement.ts +++ /dev/null @@ -1,37 +0,0 @@ -import CSVGElement from './CSVGElement'; - -export default class CSVGGraphicsElement extends CSVGElement { - declare public el?: SVGGraphicsElement; - - constructor() { - super(); - } - - public clipPath(value: string) { - if (this.el) { - this.el.setAttribute('clip-path', value); - } - return this; - } - - public clipRule(value: string) { - if (this.el) { - this.el.setAttribute('clip-rule', value); - } - return this; - } - - public clipPathUnits(value: string) { - if (this.el) { - this.el.setAttribute('clipPathUnits', value); - } - return this; - } - - public colorInterpolation(value: string) { - if (this.el) { - this.el.setAttribute('color-interpolation', value); - } - return this; - } -} diff --git a/packages/sonnet-svg/src/core/CSVGImageElement.ts b/packages/sonnet-svg/src/core/CSVGImageElement.ts deleted file mode 100644 index b5943d9..0000000 --- a/packages/sonnet-svg/src/core/CSVGImageElement.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGImageElement extends CSVGGraphicsElement { - public el?: SVGImageElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'image', - } as SVGImageElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'image'); - } - } - - public x(value: string) { - if (this.el) { - this.el.setAttribute('x', value); - } - return this; - } - - public y(value: string) { - if (this.el) { - this.el.setAttribute('y', value); - } - return this; - } - - public width(value: string) { - if (this.el) { - this.el.setAttribute('width', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public href(value: string) { - if (this.el) { - this.el.setAttribute('href', value); - this.el.setAttributeNS('http://www.w3.org/1999/xlink', 'href', value); - } - return this; - } - - public preserveAspectRatio(value: string) { - if (this.el) { - this.el.setAttribute('preserveAspectRatio', value); - } - return this; - } - - public crossOrigin(value: string) { - if (this.el) { - this.el.setAttribute('crossOrigin', value); - } - return this; - } - - public decoding(value: string) { - if (this.el) { - this.el.setAttribute('decoding', value); - } - return this; - } - - public imageRendering(value: string) { - if (this.el) { - this.el.setAttribute('imageRendering', value); - } - return this; - } - - public mask(value: string) { - if (this.el) { - this.el.setAttribute('mask', value); - } - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public overflow(value: string) { - this.el?.setAttribute('overflow', value); - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function image() { - return new CSVGImageElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGLineElement.ts b/packages/sonnet-svg/src/core/CSVGLineElement.ts deleted file mode 100644 index 274a12a..0000000 --- a/packages/sonnet-svg/src/core/CSVGLineElement.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGeometryElement from './CSVGGeometryElement'; - -export default class CSVGLineElement extends CSVGGeometryElement { - public el?: SVGLineElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'line', - } as SVGLineElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'line'); - } - } - - public x1(value: string) { - if (this.el) { - this.el.setAttribute('x1', value); - } - return this; - } - - public y1(value: string) { - if (this.el) { - this.el.setAttribute('y1', value); - } - return this; - } - - public x2(value: string) { - if (this.el) { - this.el.setAttribute('x2', value); - } - return this; - } - - public y2(value: string) { - if (this.el) { - this.el.setAttribute('y2', value); - } - return this; - } - - public pathLength(value: string) { - if (this.el) { - this.el.setAttribute('pathLength', value); - } - return this; - } - - public mask(value: string) { - if (this.el) { - this.el.setAttribute('mask', value); - } - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function line() { - return new CSVGLineElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGLinearGradientElement.ts b/packages/sonnet-svg/src/core/CSVGLinearGradientElement.ts deleted file mode 100644 index 435bbce..0000000 --- a/packages/sonnet-svg/src/core/CSVGLinearGradientElement.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGradientElement from './CSVGGradientElement'; - -export default class CSVGLinearGradientElement extends CSVGGradientElement { - public el?: SVGLinearGradientElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'linearGradient', - } as SVGLinearGradientElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'linearGradient', - ); - } - } - - public gradientUnits(value: string) { - if (this.el) { - this.el.setAttribute('gradientUnits', value); - } - return this; - } - - public x1(value: string) { - if (this.el) { - this.el.setAttribute('x1', value); - } - return this; - } - - public y1(value: string) { - if (this.el) { - this.el.setAttribute('y1', value); - } - return this; - } - - public x2(value: string) { - if (this.el) { - this.el.setAttribute('x2', value); - } - return this; - } - - public y2(value: string) { - if (this.el) { - this.el.setAttribute('y2', value); - } - return this; - } - - public spreadMethod(value: string) { - if (this.el) { - this.el.setAttribute('spreadMethod', value); - } - return this; - } - - public gradientTransform(value: string) { - if (this.el) { - this.el.setAttribute('gradientTransform', value); - } - return this; - } - - public href(value: string) { - if (this.el) { - this.el.setAttribute('href', value); - this.el.setAttributeNS('http://www.w3.org/1999/xlink', 'href', value); - } - return this; - } -} - -export function linearGradient() { - return new CSVGLinearGradientElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGMPathElement.ts b/packages/sonnet-svg/src/core/CSVGMPathElement.ts deleted file mode 100644 index d58277e..0000000 --- a/packages/sonnet-svg/src/core/CSVGMPathElement.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGMPathElement extends CSVGElement { - public el?: SVGMPathElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'mpath', - } as SVGMPathElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'mpath'); - } - } - - public href(value: string) { - if (this.el) { - this.el.setAttribute('href', value); - this.el.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:href', - value, - ); - } - return this; - } -} - -export function mpath() { - return new CSVGMPathElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGMarkerElement.ts b/packages/sonnet-svg/src/core/CSVGMarkerElement.ts deleted file mode 100644 index 563d411..0000000 --- a/packages/sonnet-svg/src/core/CSVGMarkerElement.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGMarkerElement extends CSVGElement { - public el?: SVGMarkerElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'marker', - } as SVGMarkerElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'marker', - ); - } - } - - public markerHeight(value: string) { - if (this.el) { - this.el.setAttribute('markerHeight', value); - } - return this; - } - - public markerUnits(value: string) { - if (this.el) { - this.el.setAttribute('markerUnits', value); - } - return this; - } - - public markerWidth(value: string) { - if (this.el) { - this.el.setAttribute('markerWidth', value); - } - return this; - } - - public orient(value: string) { - if (this.el) { - this.el.setAttribute('orient', value); - } - return this; - } - - public preserveAspectRatio(value: string) { - if (this.el) { - this.el.setAttribute('preserveAspectRatio', value); - } - return this; - } - - public refX(value: string) { - if (this.el) { - this.el.setAttribute('refX', value); - } - return this; - } - - public refY(value: string) { - if (this.el) { - this.el.setAttribute('refY', value); - } - return this; - } - - public viewBox(value: string) { - if (this.el) { - this.el.setAttribute('viewBox', value); - } - return this; - } - - public mask(value: string) { - if (this.el) { - this.el.setAttribute('mask', value); - } - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public overflow(value: string) { - this.el?.setAttribute('overflow', value); - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } -} - -export function marker() { - return new CSVGMarkerElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGMaskElement.ts b/packages/sonnet-svg/src/core/CSVGMaskElement.ts deleted file mode 100644 index fe49d30..0000000 --- a/packages/sonnet-svg/src/core/CSVGMaskElement.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGMaskElement extends CSVGElement { - public el?: SVGMaskElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'mask', - } as SVGMaskElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'mask'); - } - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public maskContentUnits(value: string) { - if (this.el) { - this.el.setAttribute('maskContentUnits', value); - } - return this; - } - - public maskUnits(value: string) { - if (this.el) { - this.el.setAttribute('maskUnits', value); - } - return this; - } - - public width(value: string) { - if (this.el) { - this.el.setAttribute('width', value); - } - return this; - } - - public x(value: string) { - if (this.el) { - this.el.setAttribute('x', value); - } - return this; - } - - public y(value: string) { - if (this.el) { - this.el.setAttribute('y', value); - } - return this; - } - - public mask(value: string) { - if (this.el) { - this.el.setAttribute('mask', value); - } - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } -} - -export function mask() { - return new CSVGMaskElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGMetadataElement.ts b/packages/sonnet-svg/src/core/CSVGMetadataElement.ts deleted file mode 100644 index 7020b12..0000000 --- a/packages/sonnet-svg/src/core/CSVGMetadataElement.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGMetadataElement extends CSVGElement { - public el?: SVGMetadataElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'metadata', - } as SVGMetadataElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'metadata', - ); - } - } -} - -export function metadata() { - return new CSVGMetadataElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGPathElement.ts b/packages/sonnet-svg/src/core/CSVGPathElement.ts deleted file mode 100644 index bd9d62a..0000000 --- a/packages/sonnet-svg/src/core/CSVGPathElement.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGeometryElement from './CSVGGeometryElement'; - -export default class CSVGPathElement extends CSVGGeometryElement { - public el?: SVGPathElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'path', - } as SVGPathElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'path'); - } - } - - public d(value: string) { - if (this.el) { - this.el.setAttribute('d', value); - } - return this; - } - - public pathLength(value: string) { - if (this.el) { - this.el.setAttribute('pathLength', value); - } - return this; - } - - public fillRule(value: string) { - if (this.el) { - this.el.setAttribute('fill-rule', value); - } - return this; - } - - public mask(value: string) { - if (this.el) { - this.el.setAttribute('mask', value); - } - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function path() { - return new CSVGPathElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGPatternElement.ts b/packages/sonnet-svg/src/core/CSVGPatternElement.ts deleted file mode 100644 index 03c91ff..0000000 --- a/packages/sonnet-svg/src/core/CSVGPatternElement.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGPatternElement extends CSVGElement { - public el?: SVGPatternElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'pattern', - } as SVGPatternElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'pattern', - ); - } - } - - public x(value: string) { - if (this.el) { - this.el.setAttribute('x', value); - } - return this; - } - - public y(value: string) { - if (this.el) { - this.el.setAttribute('y', value); - } - return this; - } - - public width(value: string) { - if (this.el) { - this.el.setAttribute('width', value); - } - return this; - } - - public height(value: string) { - if (this.el) { - this.el.setAttribute('height', value); - } - return this; - } - - public patternUnits(value: string) { - if (this.el) { - this.el.setAttribute('patternUnits', value); - } - return this; - } - - public patternContentUnits(value: string) { - if (this.el) { - this.el.setAttribute('patternContentUnits', value); - } - return this; - } - - public patternTransform(value: string) { - if (this.el) { - this.el.setAttribute('patternTransform', value); - } - return this; - } - - public preserveAspectRatio(value: string) { - if (this.el) { - this.el.setAttribute('preserveAspectRatio', value); - } - return this; - } - - public href(value: string) { - if (this.el) { - this.el.setAttribute('href', value); - this.el.setAttributeNS('http://www.w3.org/1999/xlink', 'href', value); - } - return this; - } - - public viewBox(value: string) { - if (this.el) { - this.el.setAttribute('viewBox', value); - } - return this; - } - - public mask(value: string) { - if (this.el) { - this.el.setAttribute('mask', value); - } - return this; - } - - public overflow(value: string) { - this.el?.setAttribute('overflow', value); - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } -} - -export function pattern() { - return new CSVGPatternElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGPolygonElement.ts b/packages/sonnet-svg/src/core/CSVGPolygonElement.ts deleted file mode 100644 index c4076aa..0000000 --- a/packages/sonnet-svg/src/core/CSVGPolygonElement.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGeometryElement from './CSVGGeometryElement'; - -export default class CSVGPolygonElement extends CSVGGeometryElement { - public el?: SVGPolygonElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'polygon', - } as SVGPolygonElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'polygon', - ); - } - } - - public points(value: string) { - if (this.el) { - this.el.setAttribute('points', value); - } - return this; - } - - public pathLength(value: string) { - if (this.el) { - this.el.setAttribute('pathLength', value); - } - return this; - } - - public fillRule(value: string) { - if (this.el) { - this.el.setAttribute('fill-rule', value); - } - return this; - } - - public mask(value: string) { - if (this.el) { - this.el.setAttribute('mask', value); - } - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function polygon() { - return new CSVGPolygonElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGPolylineElement.ts b/packages/sonnet-svg/src/core/CSVGPolylineElement.ts deleted file mode 100644 index 30e8f60..0000000 --- a/packages/sonnet-svg/src/core/CSVGPolylineElement.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGeometryElement from './CSVGGeometryElement'; - -export default class CSVGPolylineElement extends CSVGGeometryElement { - public el?: SVGPolylineElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'polyline', - } as SVGPolylineElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'polyline', - ); - } - } - - public points(value: string) { - if (this.el) { - this.el.setAttribute('points', value); - } - return this; - } - - public pathLength(value: string) { - if (this.el) { - this.el.setAttribute('pathLength', value); - } - return this; - } - - public fillRule(value: string) { - if (this.el) { - this.el.setAttribute('fill-rule', value); - } - return this; - } - - public mask(value: string) { - if (this.el) { - this.el.setAttribute('mask', value); - } - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function polyline() { - return new CSVGPolylineElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGRadialGradientElement.ts b/packages/sonnet-svg/src/core/CSVGRadialGradientElement.ts deleted file mode 100644 index 17f4cd5..0000000 --- a/packages/sonnet-svg/src/core/CSVGRadialGradientElement.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGradientElement from './CSVGGradientElement'; - -export default class CSVGRadialGradientElement extends CSVGGradientElement { - public el?: SVGRadialGradientElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'radialGradient', - } as SVGRadialGradientElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'radialGradient', - ); - } - } - - public cx(value: string) { - this.el?.setAttribute('cx', value); - return this; - } - - public cy(value: string) { - this.el?.setAttribute('cy', value); - return this; - } - - public fr(value: string) { - this.el?.setAttribute('fr', value); - return this; - } - - public fx(value: string) { - this.el?.setAttribute('fx', value); - return this; - } - - public fy(value: string) { - this.el?.setAttribute('fy', value); - return this; - } - - public r(value: string) { - this.el?.setAttribute('r', value); - return this; - } - - public spreadMethod(value: string) { - this.el?.setAttribute('spreadMethod', value); - return this; - } - - public gradientTransform(value: string) { - this.el?.setAttribute('gradientTransform', value); - return this; - } - - public href(value: string) { - this.el?.setAttribute('href', value); - this.el?.setAttributeNS('http://www.w3.org/1999/xlink', 'href', value); - return this; - } - - public gradientUnits(value: string) { - this.el?.setAttribute('gradientUnits', value); - return this; - } -} - -export function radialGradient() { - return new CSVGRadialGradientElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGRectElement.ts b/packages/sonnet-svg/src/core/CSVGRectElement.ts deleted file mode 100644 index bb0ba4b..0000000 --- a/packages/sonnet-svg/src/core/CSVGRectElement.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGeometryElement from './CSVGGeometryElement'; - -export default class CSVGRectElement extends CSVGGeometryElement { - public el?: SVGRectElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'rect', - } as SVGRectElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); - } - } - - public x(value: string) { - this.el?.setAttribute('x', value); - return this; - } - - public y(value: string) { - this.el?.setAttribute('y', value); - return this; - } - - public width(value: string) { - this.el?.setAttribute('width', value); - return this; - } - - public height(value: string) { - this.el?.setAttribute('height', value); - return this; - } - - public rx(value: string) { - this.el?.setAttribute('rx', value); - return this; - } - - public ry(value: string) { - this.el?.setAttribute('ry', value); - return this; - } - - public pathLength(value: string) { - this.el?.setAttribute('pathLength', value); - return this; - } - - public mask(value: string) { - this.el?.setAttribute('mask', value); - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } -} - -export function rect() { - return new CSVGRectElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGSVGElement.ts b/packages/sonnet-svg/src/core/CSVGSVGElement.ts deleted file mode 100644 index d0cfb25..0000000 --- a/packages/sonnet-svg/src/core/CSVGSVGElement.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGSVGElement extends CSVGGraphicsElement { - public el?: SVGSVGElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'svg', - } as SVGSVGElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - } - } - - public baseProfile(baseProfile: string) { - this.el?.setAttribute('baseProfile', baseProfile); - return this; - } - - public version(version: string) { - this.el?.setAttribute('version', version); - return this; - } - - public width(width: string) { - this.el?.setAttribute('width', width); - return this; - } - - public height(height: string) { - this.el?.setAttribute('height', height); - return this; - } - - public viewBox(value: string) { - this.el?.setAttribute('viewBox', value); - return this; - } - - public preserveAspectRatio(value: string) { - this.el?.setAttribute('preserveAspectRation', value); - return this; - } - - public x(x: string) { - this.el?.setAttribute('x', x); - return this; - } - - public y(y: string) { - this.el?.setAttribute('y', y); - return this; - } - - public mask(value: string) { - this.el?.setAttribute('mask', value); - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public overflow(value: string) { - this.el?.setAttribute('overflow', value); - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } -} - -export function svg() { - return new CSVGSVGElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGScriptElement.ts b/packages/sonnet-svg/src/core/CSVGScriptElement.ts deleted file mode 100644 index 1555c0a..0000000 --- a/packages/sonnet-svg/src/core/CSVGScriptElement.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGScriptElement extends CSVGElement { - public el?: SVGScriptElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'script', - } as SVGScriptElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'script', - ); - } - } - - public type(value: string) { - this.el?.setAttribute('type', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:type', - value, - ); - return this; - } - - public href(value: string) { - this.el?.setAttribute('href', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:href', - value, - ); - return this; - } - - public crossorigin(value: string) { - this.el?.setAttribute('crossorigin', value); - return this; - } -} - -export function script() { - return new CSVGScriptElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGSetElement.ts b/packages/sonnet-svg/src/core/CSVGSetElement.ts deleted file mode 100644 index 2857cdb..0000000 --- a/packages/sonnet-svg/src/core/CSVGSetElement.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGAnimationElement from './CSVGAnimationElement'; - -export default class CSVGSetElement extends CSVGAnimationElement { - public el?: SVGSetElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'set', - } as SVGSetElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'set'); - } - } - - public to(value: string) { - this.el?.setAttribute('to', value); - return this; - } - - public attributeName(value: string) { - this.el?.setAttribute('attributeName', value); - return this; - } - - public attributeType(value: string) { - this.el?.setAttribute('attributeType', value); - return this; - } - - public begin(value: string) { - this.el?.setAttribute('begin', value); - return this; - } - - public dur(value: string) { - this.el?.setAttribute('dur', value); - return this; - } - - public end(value: string) { - this.el?.setAttribute('end', value); - return this; - } - - public href(value: string) { - this.el?.setAttribute('href', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:href', - value, - ); - return this; - } - - public keyPoints(value: string) { - this.el?.setAttribute('keyPoints', value); - return this; - } - - public max(value: string) { - this.el?.setAttribute('max', value); - return this; - } - - public min(value: string) { - this.el?.setAttribute('min', value); - return this; - } - - public repeatCount(value: string) { - this.el?.setAttribute('repeatCount', value); - return this; - } - - public repeatDur(value: string) { - this.el?.setAttribute('repeatDur', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } -} - -export function set() { - return new CSVGSetElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGStopElement.ts b/packages/sonnet-svg/src/core/CSVGStopElement.ts deleted file mode 100644 index e766072..0000000 --- a/packages/sonnet-svg/src/core/CSVGStopElement.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGStopElement extends CSVGElement { - public el?: SVGStopElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'stop', - } as SVGStopElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'stop'); - } - } - - public offset(value: string) { - this.el?.setAttribute('offset', value); - return this; - } - - public stopColor(value: string) { - this.el?.setAttribute('stop-color', value); - return this; - } - - public stopOpacity(value: string) { - this.el?.setAttribute('stop-opacity', value); - return this; - } -} - -export function stop() { - return new CSVGStopElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGStyleElement.ts b/packages/sonnet-svg/src/core/CSVGStyleElement.ts deleted file mode 100644 index a8b8833..0000000 --- a/packages/sonnet-svg/src/core/CSVGStyleElement.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGStyleElement extends CSVGElement { - public el?: SVGStyleElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'style', - } as SVGStyleElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'style'); - } - } - - public type(value: string) { - this.el?.setAttribute('type', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:type', - value, - ); - return this; - } - - public media(value: string) { - this.el?.setAttribute('media', value); - return this; - } - - public title(value: string) { - this.el?.setAttribute('title', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:title', - value, - ); - return this; - } -} - -export function style() { - return new CSVGStyleElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGSwitchElement.ts b/packages/sonnet-svg/src/core/CSVGSwitchElement.ts deleted file mode 100644 index 5606c71..0000000 --- a/packages/sonnet-svg/src/core/CSVGSwitchElement.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGSwitchElement extends CSVGGraphicsElement { - public el?: SVGSwitchElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'switch', - } as SVGSwitchElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'switch', - ); - } - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } -} - -export function switchElement() { - return new CSVGSwitchElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGTSpanElement.ts b/packages/sonnet-svg/src/core/CSVGTSpanElement.ts deleted file mode 100644 index 27f6d4f..0000000 --- a/packages/sonnet-svg/src/core/CSVGTSpanElement.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGTextPositioningElement from './CSVGTextPositioningElement'; - -export default class CSVGTSpanElement extends CSVGTextPositioningElement { - public el?: SVGTSpanElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'tspan', - } as SVGTSpanElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); - } - } - - public x(value: string) { - this.el?.setAttribute('x', value); - return this; - } - - public y(value: string) { - this.el?.setAttribute('y', value); - return this; - } - - public dx(value: string) { - this.el?.setAttribute('dx', value); - return this; - } - - public dy(value: string) { - this.el?.setAttribute('dy', value); - return this; - } - - public rotate(value: string) { - this.el?.setAttribute('rotate', value); - return this; - } - - public lengthAdjust(value: string) { - this.el?.setAttribute('lengthAdjust', value); - return this; - } - - public textLength(value: string) { - this.el?.setAttribute('textLength', value); - return this; - } - - public baselineShift(value: string) { - this.el?.setAttribute('baselineShift', value); - return this; - } -} - -export function tspan() { - return new CSVGTSpanElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGTextContentElement.ts b/packages/sonnet-svg/src/core/CSVGTextContentElement.ts deleted file mode 100644 index 53d7c9b..0000000 --- a/packages/sonnet-svg/src/core/CSVGTextContentElement.ts +++ /dev/null @@ -1,164 +0,0 @@ -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGTextContentElement extends CSVGGraphicsElement { - public declare el?: SVGTextContentElement; - - constructor() { - super(); - } - - public direction(value: string) { - this.el?.setAttribute('direction', value); - - return this; - } - - public dominantBaseline(value: string) { - this.el?.setAttribute('dominant-baseline', value); - - return this; - } - - public fill(value: string) { - this.el?.setAttribute('fill', value); - - return this; - } - - public fillOpacity(value: string) { - this.el?.setAttribute('fill-opacity', value); - - return this; - } - - public fillRule(value: string) { - this.el?.setAttribute('fill-rule', value); - - return this; - } - - public fontFamily(value: string) { - this.el?.setAttribute('font-family', value); - - return this; - } - - public fontSize(value: string) { - this.el?.setAttribute('font-size', value); - - return this; - } - - public fontSizeAdjust(value: string) { - this.el?.setAttribute('font-size-adjust', value); - - return this; - } - - public fontStretch(value: string) { - this.el?.setAttribute('font-stretch', value); - - return this; - } - - public fontStyle(value: string) { - this.el?.setAttribute('font-style', value); - - return this; - } - - public fontVariant(value: string) { - this.el?.setAttribute('font-variant', value); - - return this; - } - - public fontWeight(value: string) { - this.el?.setAttribute('font-weight', value); - - return this; - } - - public lang(value: string) { - this.el?.setAttribute('lang', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:lang', - value, - ); - - return this; - } - - public lengthAdjust(value: string) { - this.el?.setAttribute('lengthAdjust', value); - - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public textAnchor(value: string) { - this.el?.setAttribute('text-anchor', value); - return this; - } - - public textDecoration(value: string) { - this.el?.setAttribute('text-decoration', value); - return this; - } - - public textLenght(value: string) { - this.el?.setAttribute('textLenght', value); - return this; - } - - public letterSpacing(value: string) { - this.el?.setAttribute('letter-spacing', value); - - return this; - } - public unicodeBidi(value: string) { - this.el?.setAttribute('unicode-bidi', value); - - return this; - } - - public vectorOffset(value: string) { - this.el?.setAttribute('vector-offset', value); - - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } - - public paintOrder(value: string) { - this.el?.setAttribute('paint-order', value); - } - - public visibility(value: string) { - this.el?.setAttribute('visibility', value); - return this; - } - - public wordSpacing(value: string) { - this.el?.setAttribute('word-spacing', value); - return this; - } - - public writingMode(value: string) { - this.el?.setAttribute('writing-mode', value); - return this; - } -} diff --git a/packages/sonnet-svg/src/core/CSVGTextElement.ts b/packages/sonnet-svg/src/core/CSVGTextElement.ts deleted file mode 100644 index 7b42ce3..0000000 --- a/packages/sonnet-svg/src/core/CSVGTextElement.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGTextPositioningElement from './CSVGTextPositioningElement'; - -export default class CSVGTextElement extends CSVGTextPositioningElement { - public el?: SVGTextElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'text', - } as SVGTextElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'text'); - } - } - - public x(value: string) { - this.el?.setAttribute('x', value); - return this; - } - - public y(value: string) { - this.el?.setAttribute('y', value); - return this; - } - - public dx(value: string) { - this.el?.setAttribute('dx', value); - return this; - } - - public dy(value: string) { - this.el?.setAttribute('dy', value); - return this; - } - - public rotate(value: string) { - this.el?.setAttribute('rotate', value); - return this; - } - - public textLength(value: string) { - this.el?.setAttribute('textLength', value); - return this; - } - - public lengthAdjust(value: string) { - this.el?.setAttribute('lengthAdjust', value); - return this; - } - - public mask(value: string) { - this.el?.setAttribute('mask', value); - return this; - } - - public overflow(value: string) { - this.el?.setAttribute('overflow', value); - } - - public textRendering(value: string) { - this.el?.setAttribute('text-rendering', value); - return this; - } -} - -export function text() { - return new CSVGTextElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGTextPathElement.ts b/packages/sonnet-svg/src/core/CSVGTextPathElement.ts deleted file mode 100644 index 084bc81..0000000 --- a/packages/sonnet-svg/src/core/CSVGTextPathElement.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGTextContentElement from './CSVGTextContentElement'; - -export default class CSVGTextPathElement extends CSVGTextContentElement { - public el?: SVGTextPathElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'textPath', - } as SVGTextPathElement; - } else { - this.el = document.createElementNS( - 'http://www.w3.org/2000/svg', - 'textPath', - ); - } - } - - public href(value: string) { - this.el?.setAttribute('href', value); - this.el?.setAttributeNS( - 'http://www.w3.org/1999/xlink', - 'xlink:href', - value, - ); - return this; - } - - public startOffset(value: string) { - this.el?.setAttribute('startOffset', value); - return this; - } - - public method(value: string) { - this.el?.setAttribute('method', value); - return this; - } - - public spacing(value: string) { - this.el?.setAttribute('spacing', value); - return this; - } - - public side(value: string) { - this.el?.setAttribute('side', value); - return this; - } - - public textLength(value: string) { - this.el?.setAttribute('textLength', value); - return this; - } - - public lengthAdjust(value: string) { - this.el?.setAttribute('lengthAdjust', value); - return this; - } - - public path(value: string) { - this.el?.setAttribute('path', value); - return this; - } - - public baselineShift(value: string) { - this.el?.setAttribute('baselineShift', value); - return this; - } -} - -export function textPath() { - return new CSVGTextPathElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGTextPositioningElement.ts b/packages/sonnet-svg/src/core/CSVGTextPositioningElement.ts deleted file mode 100644 index 59f1a9d..0000000 --- a/packages/sonnet-svg/src/core/CSVGTextPositioningElement.ts +++ /dev/null @@ -1,9 +0,0 @@ -import CSVGTextContentElement from './CSVGTextContentElement'; - -export default class CSVGTextPositioningElement extends CSVGTextContentElement { - declare public el?: SVGTextPositioningElement; - - constructor() { - super(); - } -} diff --git a/packages/sonnet-svg/src/core/CSVGTitleElement.ts b/packages/sonnet-svg/src/core/CSVGTitleElement.ts deleted file mode 100644 index 058e4e5..0000000 --- a/packages/sonnet-svg/src/core/CSVGTitleElement.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGTitleElement extends CSVGElement { - public el?: SVGTitleElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'title', - } as SVGTitleElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'title'); - } - } -} - -export function title() { - return new CSVGTitleElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGUseElement.ts b/packages/sonnet-svg/src/core/CSVGUseElement.ts deleted file mode 100644 index 3e6c3d6..0000000 --- a/packages/sonnet-svg/src/core/CSVGUseElement.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGGraphicsElement from './CSVGGraphicsElement'; - -export default class CSVGUseElement extends CSVGGraphicsElement { - public el?: SVGUseElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'use', - } as SVGUseElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'use'); - } - } - - public href(value: string) { - this.el?.setAttribute('href', value); - this.el?.setAttributeNS('http://www.w3.org/1999/xlink', 'href', value); - return this; - } - - public width(width: string | number) { - this.el?.setAttribute('width', width.toString()); - return this; - } - - public height(height: string | number) { - this.el?.setAttribute('height', height.toString()); - return this; - } - - public x(x: string | number) { - this.el?.setAttribute('x', x.toString()); - return this; - } - - public y(y: string | number) { - this.el?.setAttribute('y', y.toString()); - return this; - } - - public mask(value: string) { - this.el?.setAttribute('mask', value); - return this; - } - - public pointerEvents(value: string) { - this.el?.setAttribute('pointer-events', value); - return this; - } - - public systemLanguage(value: string) { - this.el?.setAttribute('systemLanguage', value); - return this; - } - - public vectorOffset(value: string) { - this.el?.setAttribute('vector-offset', value); - return this; - } - - public opacity(value: string) { - this.el?.setAttribute('opacity', value); - return this; - } -} - -export function use() { - return new CSVGUseElement(); -} diff --git a/packages/sonnet-svg/src/core/CSVGViewElement.ts b/packages/sonnet-svg/src/core/CSVGViewElement.ts deleted file mode 100644 index a94654d..0000000 --- a/packages/sonnet-svg/src/core/CSVGViewElement.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { isServer } from '@sonnetjs/shared'; -import CSVGElement from './CSVGElement'; - -export default class CSVGViewElement extends CSVGElement { - public el?: SVGViewElement; - - constructor() { - super(); - if (isServer()) { - this.el = { - tagName: 'view', - } as SVGViewElement; - } else { - this.el = document.createElementNS('http://www.w3.org/2000/svg', 'view'); - } - } - - public viewBox(value: string) { - this.el?.setAttribute('viewBox', value); - return this; - } -} - -export function view() { - return new CSVGViewElement(); -} diff --git a/packages/sonnet-svg/src/index.ts b/packages/sonnet-svg/src/index.ts deleted file mode 100644 index 333b6c1..0000000 --- a/packages/sonnet-svg/src/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -export { a } from './core/CSVGAElement'; -export { animate } from './core/CSVGAnimateElement'; -export { animateMotion } from './core/CSVGAnimateMotionElement'; -export { animateTransform } from './core/CSVGAnimateTransformElement'; -export { circle } from './core/CSVGCircleElement'; -export { clipPath } from './core/CSVGClipPathElement'; -export { defs } from './core/CSVGDefsElement'; -export { desc } from './core/CSVGDescElement'; -export { ellipse } from './core/CSVGEllipseElement'; -export { feBlend } from './core/CSVGFEBlendElement'; -export { feColorMatrix } from './core/CSVGFEColorMatrixElement'; -export { feComponentTransfer } from './core/CSVGFEComponentTransferElement'; -export { feComposite } from './core/CSVGFECompositeElement'; -export { feConvolveMatrix } from './core/CSVGFEConvolveMatrixElement'; -export { feDiffuseLighting } from './core/CSVGFEDiffuseLightingElement'; -export { feDisplacementMap } from './core/CSVGFEDisplacementMapElement'; -export { feDistantLight } from './core/CSVGFEDistantLightElement'; -export { feDropShadow } from './core/CSVGFEDropShadowElement'; -export { feFlood } from './core/CSVGFEFloodElement'; -export { feFuncA } from './core/CSVGFEFuncAElement'; -export { feFuncB } from './core/CSVGFEFuncBElement'; -export { feFuncG } from './core/CSVGFEFuncGElement'; -export { feFuncR } from './core/CSVGFEFuncRElement'; -export { feGaussianBlur } from './core/CSVGFEGaussianBlurElement'; -export { feImage } from './core/CSVGFEImageElement'; -export { feMerge } from './core/CSVGFEMergeElement'; -export { feMorphology } from './core/CSVGFEMorphologyElement'; -export { feOffset } from './core/CSVGFEOffsetElement'; -export { fePointLight } from './core/CSVGFEPointLightElement'; -export { feSpecularLighting } from './core/CSVGFESpecularLightingElement'; -export { feSpotLight } from './core/CSVGFESpotLightElement'; -export { feTile } from './core/CSVGFETileElement'; -export { feTurbulence } from './core/CSVGFETurbulenceElement'; -export { filter } from './core/CSVGFilterElement'; -export { foreignObject } from './core/CSVGForeignObjectElement'; -export { g } from './core/CSVGGElement'; -export { image } from './core/CSVGImageElement'; -export { linearGradient } from './core/CSVGLinearGradientElement'; -export { line } from './core/CSVGLineElement'; -export { marker } from './core/CSVGMarkerElement'; -export { mask } from './core/CSVGMaskElement'; -export { metadata } from './core/CSVGMetadataElement'; -export { mpath } from './core/CSVGMPathElement'; -export { path } from './core/CSVGPathElement'; -export { pattern } from './core/CSVGPatternElement'; -export { polyline } from './core/CSVGPolylineElement'; -export { radialGradient } from './core/CSVGRadialGradientElement'; -export { rect } from './core/CSVGRectElement'; -export { script } from './core/CSVGScriptElement'; -export { set } from './core/CSVGSetElement'; -export { stop } from './core/CSVGStopElement'; -export { style } from './core/CSVGStyleElement'; -export { svg } from './core/CSVGSVGElement'; -export { switchElement } from './core/CSVGSwitchElement'; -export { text } from './core/CSVGTextElement'; -export { textPath } from './core/CSVGTextPathElement'; -export { title } from './core/CSVGTitleElement'; -export { tspan } from './core/CSVGTSpanElement'; -export { use } from './core/CSVGUseElement'; -export { view } from './core/CSVGViewElement'; diff --git a/packages/sonnet-svg/tsconfig.json b/packages/sonnet-svg/tsconfig.json deleted file mode 100644 index 47044d8..0000000 --- a/packages/sonnet-svg/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "@repo/typescript-config/base.json", - "include": ["."], - "exclude": ["node_modules", "dist", "build"] -} diff --git a/packages/sonnet-svg/tsup.config.ts b/packages/sonnet-svg/tsup.config.ts deleted file mode 100644 index 620b3c8..0000000 --- a/packages/sonnet-svg/tsup.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig(() => ({ - entryPoints: ['src/index.ts'], - format: ['esm'], - dts: true, - sourcemap: false, - minify: true, -})); diff --git a/turbo.json b/turbo.json index d3e52ca..9108cd1 100644 --- a/turbo.json +++ b/turbo.json @@ -2,13 +2,17 @@ "$schema": "https://turbo.build/schema.json", "pipeline": { "build": { - "dependsOn": ["^build"], - "outputs": ["dist/**"] + "dependsOn": [ + "^build" + ], + "outputs": [ + "dist/**" + ] }, "lint": {}, "dev": { "cache": false, - "persistent": true + "persistent": false } } -} +} \ No newline at end of file