aptechka 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{client-lib/Animation-uimN7sdT.js → lib/Animation-DF5jPON_.js} +23 -28
- package/lib/Animation-seVC6-fS.cjs +1 -0
- package/lib/Composed-ChlKoJEp.cjs +1 -0
- package/lib/Composed-CoX1ImVk.js +31 -0
- package/lib/Damped-BDO-F13V.js +53 -0
- package/lib/Damped-C7WAqKPh.cjs +1 -0
- package/lib/Derived-B-2UXnVE.cjs +1 -0
- package/lib/Derived-CDGpSMKu.js +56 -0
- package/{client-lib/SourceManager--L_rA28b.js → lib/SourceManager-B8-EMNnd.js} +26 -30
- package/lib/SourceManager-TzU9Rw08.cjs +1 -0
- package/lib/Store-BnA-dJsE.cjs +1 -0
- package/{client-lib/Store-Qr3SNOSf.js → lib/Store-DGtldlBH.js} +29 -34
- package/lib/Tweened-CHhmfvzo.js +44 -0
- package/lib/Tweened-DSXD0I0k.cjs +1 -0
- package/lib/Viewport-BmLTk_6k.cjs +1 -0
- package/lib/Viewport-DTlImj28.js +123 -0
- package/lib/accordion/index.cjs +1 -0
- package/lib/accordion/index.js +167 -0
- package/{client-lib → lib}/animation/index.cjs +1 -1
- package/lib/animation/index.js +8 -0
- package/lib/attribute/index.cjs +1 -0
- package/{client-lib → lib}/attribute/index.js +15 -20
- package/lib/canvas/index.cjs +1 -0
- package/lib/canvas/index.js +111 -0
- package/lib/checkbox/index.cjs +1 -0
- package/{client-lib → lib}/checkbox/index.js +20 -25
- package/lib/class-linked-status/index.cjs +1 -0
- package/lib/class-linked-status/index.js +45 -0
- package/lib/connector/index.cjs +1 -0
- package/{client-lib → lib}/connector/index.js +14 -18
- package/lib/controls/index.cjs +1 -0
- package/lib/controls/index.js +207 -0
- package/{client-lib/createStylesheet-BqjaCUhm.cjs → lib/createStylesheet-CaDI99iu.cjs} +1 -1
- package/{client-lib/createStylesheet-DNG2b5X4.js → lib/createStylesheet-DO5t5q-m.js} +1 -1
- package/lib/css-property/index.cjs +1 -0
- package/lib/css-property/index.js +58 -0
- package/lib/css-unit-parser/index.cjs +8 -0
- package/lib/css-unit-parser/index.js +31 -0
- package/{client-lib → lib}/dev/index.cjs +1 -1
- package/{client-lib → lib}/dev/index.js +1 -1
- package/{client-lib → lib}/device/index.cjs +1 -1
- package/{client-lib → lib}/device/index.js +1 -1
- package/{client-lib → lib}/element-constructor/index.cjs +1 -1
- package/{client-lib → lib}/element-constructor/index.js +2 -2
- package/lib/element-resizer/index.cjs +1 -0
- package/{client-lib → lib}/element-resizer/index.js +12 -16
- package/lib/en3/helpers/index.cjs +1 -0
- package/{client-lib → lib}/en3/helpers/index.js +612 -646
- package/{client-lib → lib}/en3/index.cjs +1 -1
- package/lib/en3/index.js +6 -0
- package/{client-lib → lib}/en3/libs/index.js +1 -2
- package/lib/en3/loaders/index.cjs +1 -0
- package/{client-lib → lib}/en3/loaders/index.js +152 -167
- package/lib/en3/misc/index.cjs +10 -0
- package/{client-lib → lib}/en3/misc/index.js +18 -23
- package/{client-lib → lib}/en3/utils/index.cjs +1 -1
- package/{client-lib → lib}/en3/utils/index.js +2 -2
- package/lib/en3-C1fLmsjs.cjs +8 -0
- package/{client-lib/en3-THFHEReu.js → lib/en3-x-Ki30MY.js} +59 -64
- package/{client-lib → lib}/image/index.cjs +1 -1
- package/{client-lib → lib}/image/index.js +1 -1
- package/{client-lib/index-BuvwT3dS.js → lib/index-BhbT9PrL.js} +35 -40
- package/lib/index-BpsQqM-8.cjs +9 -0
- package/lib/intersector/index.cjs +1 -0
- package/{client-lib → lib}/intersector/index.js +12 -16
- package/lib/ladder/index.cjs +1 -0
- package/{client-lib → lib}/ladder/index.js +20 -25
- package/lib/layout-box/index.cjs +1 -0
- package/lib/layout-box/index.js +318 -0
- package/lib/loading/index.cjs +1 -0
- package/{client-lib → lib}/loading/index.js +17 -21
- package/lib/media/index.cjs +1 -0
- package/lib/media/index.js +26 -0
- package/lib/modal/index.cjs +1 -0
- package/{client-lib → lib}/modal/index.js +22 -26
- package/lib/morph/index.cjs +1 -0
- package/lib/morph/index.js +225 -0
- package/lib/notifier/index.cjs +1 -0
- package/lib/notifier/index.js +36 -0
- package/lib/pointer/index.cjs +1 -0
- package/{client-lib → lib}/pointer/index.js +37 -41
- package/lib/popover/index.cjs +1 -0
- package/{client-lib → lib}/popover/index.js +71 -79
- package/lib/router/index.cjs +1 -0
- package/{client-lib → lib}/router/index.js +54 -60
- package/lib/scroll/index.cjs +1 -0
- package/lib/scroll/index.js +1131 -0
- package/lib/scroll-entries/index.cjs +1 -0
- package/{client-lib → lib}/scroll-entries/index.js +11 -15
- package/{client-lib → lib}/select/index.cjs +1 -1
- package/{client-lib → lib}/select/index.js +1 -1
- package/lib/sequence/index.cjs +1 -0
- package/{client-lib → lib}/sequence/index.js +26 -30
- package/lib/slicer/index.cjs +11 -0
- package/{client-lib → lib}/slicer/index.js +27 -31
- package/lib/source/index.cjs +5 -0
- package/{client-lib → lib}/source/index.js +19 -24
- package/lib/store/index.cjs +1 -0
- package/{client-lib → lib}/store/index.js +29 -33
- package/{client-lib → lib}/svg-path-data/index.js +3 -6
- package/lib/tags-4AoxVUe3.js +833 -0
- package/lib/tags-v-OSVkiQ.cjs +1 -0
- package/{client-lib → lib}/theme/index.cjs +1 -1
- package/{client-lib → lib}/theme/index.js +2 -2
- package/lib/ticker/index.cjs +1 -0
- package/lib/ticker/index.js +119 -0
- package/{client-lib/traverseMaterials-BtBXV88O.cjs → lib/traverseMaterials-CD_3_56D.cjs} +1 -1
- package/{client-lib/traverseMaterials-BKSwwNmo.js → lib/traverseMaterials-mGC2_FkG.js} +1 -1
- package/lib/tweaker/index.cjs +10 -0
- package/{client-lib → lib}/tweaker/index.js +271 -279
- package/{client-lib → lib}/utils/index.js +1 -2
- package/lib/video/index.cjs +1 -0
- package/{client-lib → lib}/video/index.js +13 -17
- package/lib/window-resizer/index.cjs +1 -0
- package/lib/window-resizer/index.js +42 -0
- package/package.json +351 -378
- package/client-lib/Animation-BInSRYNr.cjs +0 -1
- package/client-lib/Composed-Fa7owymK.js +0 -35
- package/client-lib/Composed-Iihn8fT4.cjs +0 -1
- package/client-lib/Damped-Da3EnNN4.cjs +0 -1
- package/client-lib/Damped-yrNXlkDE.js +0 -57
- package/client-lib/Derived-CNbsNMn_.cjs +0 -1
- package/client-lib/Derived-rInkx3e4.js +0 -60
- package/client-lib/SourceManager-D6D2LVKf.cjs +0 -1
- package/client-lib/Store-Cr3VaD9G.cjs +0 -1
- package/client-lib/Tweened-CjgvoOwL.js +0 -48
- package/client-lib/Tweened-DksN-Rz6.cjs +0 -1
- package/client-lib/Viewport-BBYt1Ivy.cjs +0 -1
- package/client-lib/Viewport-Cgtq2I_K.js +0 -127
- package/client-lib/accordion/AccordionElement.d.ts +0 -30
- package/client-lib/accordion/index.cjs +0 -1
- package/client-lib/accordion/index.d.ts +0 -1
- package/client-lib/accordion/index.js +0 -176
- package/client-lib/animation/Animation.d.ts +0 -35
- package/client-lib/animation/Damped.d.ts +0 -19
- package/client-lib/animation/Tweened.d.ts +0 -15
- package/client-lib/animation/index.d.ts +0 -3
- package/client-lib/animation/index.js +0 -8
- package/client-lib/attribute/index.cjs +0 -1
- package/client-lib/attribute/index.d.ts +0 -15
- package/client-lib/canvas/index.cjs +0 -1
- package/client-lib/canvas/index.d.ts +0 -35
- package/client-lib/canvas/index.js +0 -119
- package/client-lib/checkbox/index.cjs +0 -1
- package/client-lib/checkbox/index.d.ts +0 -14
- package/client-lib/class-linked-status/index.cjs +0 -1
- package/client-lib/class-linked-status/index.d.ts +0 -12
- package/client-lib/class-linked-status/index.js +0 -49
- package/client-lib/connector/index.cjs +0 -1
- package/client-lib/connector/index.d.ts +0 -15
- package/client-lib/controls/AutoplayControls.d.ts +0 -17
- package/client-lib/controls/Controls.d.ts +0 -9
- package/client-lib/controls/DragControls.d.ts +0 -16
- package/client-lib/controls/KeyboardControls.d.ts +0 -14
- package/client-lib/controls/WheelControls.d.ts +0 -19
- package/client-lib/controls/index.cjs +0 -1
- package/client-lib/controls/index.d.ts +0 -5
- package/client-lib/controls/index.js +0 -213
- package/client-lib/counter/index.d.ts +0 -6
- package/client-lib/css-property/index.cjs +0 -1
- package/client-lib/css-property/index.d.ts +0 -17
- package/client-lib/css-property/index.js +0 -62
- package/client-lib/css-unit-parser/index.cjs +0 -8
- package/client-lib/css-unit-parser/index.d.ts +0 -6
- package/client-lib/css-unit-parser/index.js +0 -36
- package/client-lib/css-value-parser/index.d.ts +0 -6
- package/client-lib/dev/index.d.ts +0 -1
- package/client-lib/device/Device.d.ts +0 -19
- package/client-lib/device/Viewport.d.ts +0 -29
- package/client-lib/device/index.d.ts +0 -2
- package/client-lib/element-constructor/ElementConstructor.d.ts +0 -75
- package/client-lib/element-constructor/createStylesheet.d.ts +0 -3
- package/client-lib/element-constructor/createTheme.d.ts +0 -13
- package/client-lib/element-constructor/index.d.ts +0 -4
- package/client-lib/element-constructor/knownSvgTags.d.ts +0 -1
- package/client-lib/element-constructor/tags.d.ts +0 -119
- package/client-lib/element-resizer/index.cjs +0 -1
- package/client-lib/element-resizer/index.d.ts +0 -10
- package/client-lib/en3/core/En3Raycaster.d.ts +0 -21
- package/client-lib/en3/core/En3View.d.ts +0 -40
- package/client-lib/en3/core/en3.d.ts +0 -39
- package/client-lib/en3/core/en3Cache.d.ts +0 -4
- package/client-lib/en3/helpers/En3ComposerManager.d.ts +0 -5
- package/client-lib/en3/helpers/En3GridHelper.d.ts +0 -8
- package/client-lib/en3/helpers/En3Helpers.d.ts +0 -5
- package/client-lib/en3/helpers/En3Object3dManager.d.ts +0 -14
- package/client-lib/en3/helpers/En3OrbitControls.d.ts +0 -8
- package/client-lib/en3/helpers/En3ParametersManager.d.ts +0 -16
- package/client-lib/en3/helpers/En3TransformControls.d.ts +0 -8
- package/client-lib/en3/helpers/index.cjs +0 -1
- package/client-lib/en3/helpers/index.d.ts +0 -2
- package/client-lib/en3/index.d.ts +0 -3
- package/client-lib/en3/index.js +0 -6
- package/client-lib/en3/libs/MeshoptDecoder.d.ts +0 -1
- package/client-lib/en3/libs/index.d.ts +0 -1
- package/client-lib/en3/loaders/En3GLTFLoader.d.ts +0 -12
- package/client-lib/en3/loaders/En3TextureLoader.d.ts +0 -8
- package/client-lib/en3/loaders/index.cjs +0 -1
- package/client-lib/en3/loaders/index.d.ts +0 -3
- package/client-lib/en3/loaders/loaders.d.ts +0 -13
- package/client-lib/en3/misc/En3ModifiedMaterial.d.ts +0 -33
- package/client-lib/en3/misc/En3SourceManager.d.ts +0 -32
- package/client-lib/en3/misc/index.cjs +0 -10
- package/client-lib/en3/misc/index.d.ts +0 -2
- package/client-lib/en3/objects/En3Clip.d.ts +0 -15
- package/client-lib/en3/objects/En3ClipHelpers.d.ts +0 -6
- package/client-lib/en3/objects/En3GLTF.d.ts +0 -11
- package/client-lib/en3/objects/En3Image.d.ts +0 -8
- package/client-lib/en3/objects/En3ImageLike.d.ts +0 -25
- package/client-lib/en3/objects/En3SourceConsumer.d.ts +0 -5
- package/client-lib/en3/objects/En3Video.d.ts +0 -13
- package/client-lib/en3/objects/fluid/Advection.d.ts +0 -30
- package/client-lib/en3/objects/fluid/Divergence.d.ts +0 -23
- package/client-lib/en3/objects/fluid/En3Fluid.d.ts +0 -16
- package/client-lib/en3/objects/fluid/En3FluidElement.d.ts +0 -13
- package/client-lib/en3/objects/fluid/En3FluidPointer.d.ts +0 -13
- package/client-lib/en3/objects/fluid/ExternalForce.d.ts +0 -19
- package/client-lib/en3/objects/fluid/Poisson.d.ts +0 -24
- package/client-lib/en3/objects/fluid/Pressure.d.ts +0 -26
- package/client-lib/en3/objects/fluid/ShaderPass.d.ts +0 -24
- package/client-lib/en3/objects/fluid/Simulation.d.ts +0 -33
- package/client-lib/en3/objects/fluid/Viscous.d.ts +0 -30
- package/client-lib/en3/objects/fluid/index.d.ts +0 -3
- package/client-lib/en3/objects/index.d.ts +0 -7
- package/client-lib/en3/utils/coverTexture.d.ts +0 -7
- package/client-lib/en3/utils/dispose.d.ts +0 -3
- package/client-lib/en3/utils/getCurrentViewport.d.ts +0 -9
- package/client-lib/en3/utils/index.d.ts +0 -5
- package/client-lib/en3/utils/traverseMaterials.d.ts +0 -3
- package/client-lib/en3/utils/traverseMeshes.d.ts +0 -3
- package/client-lib/en3-CBBYE8rb.cjs +0 -8
- package/client-lib/image/index.d.ts +0 -11
- package/client-lib/index-Ctct2GyP.cjs +0 -9
- package/client-lib/intersector/index.cjs +0 -1
- package/client-lib/intersector/index.d.ts +0 -10
- package/client-lib/ladder/index.cjs +0 -1
- package/client-lib/ladder/index.d.ts +0 -24
- package/client-lib/layout-box/index.cjs +0 -1
- package/client-lib/layout-box/index.d.ts +0 -96
- package/client-lib/layout-box/index.js +0 -326
- package/client-lib/libs/path-data-polyfill.d.ts +0 -1
- package/client-lib/loading/index.cjs +0 -1
- package/client-lib/loading/index.d.ts +0 -39
- package/client-lib/media/index.cjs +0 -1
- package/client-lib/media/index.d.ts +0 -12
- package/client-lib/media/index.js +0 -30
- package/client-lib/modal/ModalElement.d.ts +0 -13
- package/client-lib/modal/index.cjs +0 -1
- package/client-lib/modal/index.d.ts +0 -1
- package/client-lib/morph/Link.d.ts +0 -7
- package/client-lib/morph/Morph.d.ts +0 -37
- package/client-lib/morph/index.cjs +0 -1
- package/client-lib/morph/index.d.ts +0 -1
- package/client-lib/morph/index.js +0 -235
- package/client-lib/notifier/index.cjs +0 -1
- package/client-lib/notifier/index.d.ts +0 -8
- package/client-lib/notifier/index.js +0 -40
- package/client-lib/order/index.d.ts +0 -22
- package/client-lib/pointer/Pointer.d.ts +0 -23
- package/client-lib/pointer/PointerElement.d.ts +0 -14
- package/client-lib/pointer/index.cjs +0 -1
- package/client-lib/pointer/index.d.ts +0 -2
- package/client-lib/popover/PopoverButtonElement.d.ts +0 -15
- package/client-lib/popover/PopoverElement.d.ts +0 -26
- package/client-lib/popover/index.cjs +0 -1
- package/client-lib/popover/index.d.ts +0 -2
- package/client-lib/router/Link.d.ts +0 -7
- package/client-lib/router/Route.d.ts +0 -21
- package/client-lib/router/Router.d.ts +0 -41
- package/client-lib/router/index.cjs +0 -1
- package/client-lib/router/index.d.ts +0 -2
- package/client-lib/scroll/ScrollBulletButtonsElement.d.ts +0 -12
- package/client-lib/scroll/ScrollButtonElement.d.ts +0 -6
- package/client-lib/scroll/ScrollElement.d.ts +0 -82
- package/client-lib/scroll/ScrollSection.d.ts +0 -23
- package/client-lib/scroll/ScrollSegmentElement.d.ts +0 -63
- package/client-lib/scroll/ScrollSetButtonElement.d.ts +0 -10
- package/client-lib/scroll/ScrollStepButtonElement.d.ts +0 -10
- package/client-lib/scroll/ScrollUserElement.d.ts +0 -7
- package/client-lib/scroll/ScrollbarElement.d.ts +0 -14
- package/client-lib/scroll/index.cjs +0 -1
- package/client-lib/scroll/index.d.ts +0 -6
- package/client-lib/scroll/index.js +0 -1154
- package/client-lib/scroll-entries/index.cjs +0 -1
- package/client-lib/scroll-entries/index.d.ts +0 -21
- package/client-lib/select/SelectElement.d.ts +0 -24
- package/client-lib/select/SelectHeadElement.d.ts +0 -13
- package/client-lib/select/SelectOptionElement.d.ts +0 -14
- package/client-lib/select/SelectUserElement.d.ts +0 -7
- package/client-lib/select/index.d.ts +0 -4
- package/client-lib/sequence/index.cjs +0 -1
- package/client-lib/sequence/index.d.ts +0 -21
- package/client-lib/slicer/DecoderElement.d.ts +0 -11
- package/client-lib/slicer/Letter.d.ts +0 -11
- package/client-lib/slicer/SlicerElement.d.ts +0 -21
- package/client-lib/slicer/Word.d.ts +0 -17
- package/client-lib/slicer/index.cjs +0 -11
- package/client-lib/slicer/index.d.ts +0 -4
- package/client-lib/source/SourceClass.d.ts +0 -11
- package/client-lib/source/SourceElement.d.ts +0 -25
- package/client-lib/source/SourceManager.d.ts +0 -14
- package/client-lib/source/SourceSet.d.ts +0 -9
- package/client-lib/source/index.cjs +0 -5
- package/client-lib/source/index.d.ts +0 -4
- package/client-lib/store/Cached.d.ts +0 -18
- package/client-lib/store/Composed.d.ts +0 -8
- package/client-lib/store/Derived.d.ts +0 -13
- package/client-lib/store/DerivedArray.d.ts +0 -13
- package/client-lib/store/Resource.d.ts +0 -12
- package/client-lib/store/Store.d.ts +0 -76
- package/client-lib/store/StoreRegistry.d.ts +0 -23
- package/client-lib/store/index.cjs +0 -1
- package/client-lib/store/index.d.ts +0 -7
- package/client-lib/svg-path-data/index.d.ts +0 -15
- package/client-lib/tags-B0do5eeb.cjs +0 -1
- package/client-lib/tags-wG5k157g.js +0 -860
- package/client-lib/test/starting-style/index.d.ts +0 -1
- package/client-lib/theme/index.d.ts +0 -35
- package/client-lib/ticker/index.cjs +0 -1
- package/client-lib/ticker/index.d.ts +0 -22
- package/client-lib/ticker/index.js +0 -125
- package/client-lib/tweaker/TweakerBooleanManagerElement.d.ts +0 -11
- package/client-lib/tweaker/TweakerColorManagerElement.d.ts +0 -11
- package/client-lib/tweaker/TweakerElement.d.ts +0 -18
- package/client-lib/tweaker/TweakerFieldElement.d.ts +0 -21
- package/client-lib/tweaker/TweakerFolderElement.d.ts +0 -24
- package/client-lib/tweaker/TweakerLinkManagerElement.d.ts +0 -11
- package/client-lib/tweaker/TweakerNumberManagerElement.d.ts +0 -14
- package/client-lib/tweaker/TweakerSelectManagerElement.d.ts +0 -11
- package/client-lib/tweaker/TweakerStoreManagerElement.d.ts +0 -10
- package/client-lib/tweaker/TweakerStringManagerElement.d.ts +0 -11
- package/client-lib/tweaker/index.cjs +0 -10
- package/client-lib/tweaker/index.d.ts +0 -1
- package/client-lib/tweaker/tweakerManagerConstructors.d.ts +0 -6
- package/client-lib/tweaker/tweakerStorage.d.ts +0 -23
- package/client-lib/utils/array.d.ts +0 -2
- package/client-lib/utils/attributes.d.ts +0 -2
- package/client-lib/utils/browser.d.ts +0 -1
- package/client-lib/utils/bytes.d.ts +0 -1
- package/client-lib/utils/canvas.d.ts +0 -7
- package/client-lib/utils/collisions.d.ts +0 -4
- package/client-lib/utils/coordinates.d.ts +0 -14
- package/client-lib/utils/cssom.d.ts +0 -5
- package/client-lib/utils/decoding.d.ts +0 -2
- package/client-lib/utils/dom.d.ts +0 -5
- package/client-lib/utils/easings.d.ts +0 -17
- package/client-lib/utils/events.d.ts +0 -8
- package/client-lib/utils/file.d.ts +0 -1
- package/client-lib/utils/function.d.ts +0 -2
- package/client-lib/utils/gestures.d.ts +0 -1
- package/client-lib/utils/index.d.ts +0 -26
- package/client-lib/utils/layout.d.ts +0 -3
- package/client-lib/utils/math.d.ts +0 -12
- package/client-lib/utils/number.d.ts +0 -3
- package/client-lib/utils/object.d.ts +0 -9
- package/client-lib/utils/polyfills.d.ts +0 -1
- package/client-lib/utils/promises.d.ts +0 -1
- package/client-lib/utils/string.d.ts +0 -8
- package/client-lib/utils/style.d.ts +0 -2
- package/client-lib/utils/ts-shape.d.ts +0 -20
- package/client-lib/utils/ts-utility.d.ts +0 -26
- package/client-lib/utils/url.d.ts +0 -9
- package/client-lib/video/index.cjs +0 -1
- package/client-lib/video/index.d.ts +0 -22
- package/client-lib/window-resizer/index.cjs +0 -1
- package/client-lib/window-resizer/index.d.ts +0 -10
- package/client-lib/window-resizer/index.js +0 -46
- package/server-lib/optimizer/FFmpeg.d.ts +0 -10
- package/server-lib/optimizer/generateFavicon.d.ts +0 -4
- package/server-lib/optimizer/generateSequence.d.ts +0 -3
- package/server-lib/optimizer/generateSprite.d.ts +0 -4
- package/server-lib/optimizer/index.d.ts +0 -10
- package/server-lib/optimizer/index.js +0 -404
- package/server-lib/optimizer/inputFiles.d.ts +0 -26
- package/server-lib/optimizer/optimize.d.ts +0 -13
- package/server-lib/optimizer/optimizeImage.d.ts +0 -4
- package/server-lib/optimizer/optimizeVideo.d.ts +0 -3
- package/server-lib/optimizer/optimizer.d.ts +0 -5
- package/server-lib/optimizer/types.d.ts +0 -51
- package/server-lib/optimizer/utils.d.ts +0 -1
- package/server-lib/utils/buffer.d.ts +0 -1
- package/server-lib/utils/fs.d.ts +0 -11
- package/server-lib/utils/index.d.ts +0 -5
- package/server-lib/utils/index.js +0 -65
- package/server-lib/utils/math.d.ts +0 -1
- package/server-lib/utils/path.d.ts +0 -3
- package/server-lib/utils/types.d.ts +0 -8
- /package/{client-lib → lib}/attributes-69we3byR.js +0 -0
- /package/{client-lib → lib}/attributes-Bf2svn4j.cjs +0 -0
- /package/{client-lib → lib}/browser-0zX67oeU.js +0 -0
- /package/{client-lib → lib}/browser-CpzFX2xg.cjs +0 -0
- /package/{client-lib → lib}/canvas-CU5Xjahf.cjs +0 -0
- /package/{client-lib → lib}/canvas-DeZ0SLUJ.js +0 -0
- /package/{client-lib → lib}/coordinates-CgdGoSYs.js +0 -0
- /package/{client-lib → lib}/coordinates-D8Np3cPD.cjs +0 -0
- /package/{client-lib → lib}/createTheme-CHnsCgAr.js +0 -0
- /package/{client-lib → lib}/createTheme-Cfaw9UmV.cjs +0 -0
- /package/{client-lib → lib}/css-value-parser/index.cjs +0 -0
- /package/{client-lib → lib}/css-value-parser/index.js +0 -0
- /package/{client-lib → lib}/dom-JBOkFLTh.cjs +0 -0
- /package/{client-lib → lib}/dom-P5QbAASX.js +0 -0
- /package/{client-lib → lib}/easings-BKi40vHz.js +0 -0
- /package/{client-lib → lib}/easings-DsS5-Kqc.cjs +0 -0
- /package/{client-lib → lib}/en3/libs/index.cjs +0 -0
- /package/{client-lib → lib}/events-BGwqaxVW.cjs +0 -0
- /package/{client-lib → lib}/events-CJTUMSLU.js +0 -0
- /package/{client-lib → lib}/file-EevnUtRj.cjs +0 -0
- /package/{client-lib → lib}/file-lxi_oXJf.js +0 -0
- /package/{client-lib → lib}/function-C10DGppn.js +0 -0
- /package/{client-lib → lib}/function-MthRj-GJ.cjs +0 -0
- /package/{client-lib → lib}/gestures-D2Fdra_G.js +0 -0
- /package/{client-lib → lib}/gestures-DHLrn6Q8.cjs +0 -0
- /package/{client-lib → lib}/layout-8ryRAMGJ.cjs +0 -0
- /package/{client-lib → lib}/layout-HoBT_Da2.js +0 -0
- /package/{client-lib → lib}/math-BOBiC4TN.js +0 -0
- /package/{client-lib → lib}/math-GDWEqu7y.cjs +0 -0
- /package/{client-lib → lib}/object-CCiXnER2.cjs +0 -0
- /package/{client-lib → lib}/object-D6MVWB4l.js +0 -0
- /package/{client-lib → lib}/order/index.cjs +0 -0
- /package/{client-lib → lib}/order/index.js +0 -0
- /package/{client-lib → lib}/polyfills-CM4SCDTt.cjs +0 -0
- /package/{client-lib → lib}/polyfills-X6KXuHg-.js +0 -0
- /package/{client-lib → lib}/string-DhgS_iFl.cjs +0 -0
- /package/{client-lib → lib}/string-f0Dnk0L1.js +0 -0
- /package/{client-lib → lib}/style-At6aDoqG.cjs +0 -0
- /package/{client-lib → lib}/style-j2TwriJ_.js +0 -0
- /package/{client-lib → lib}/svg-path-data/index.cjs +0 -0
- /package/{client-lib → lib}/url-C3dWnJQg.cjs +0 -0
- /package/{client-lib → lib}/url-DMNfW7uN.js +0 -0
- /package/{client-lib → lib}/utils/index.cjs +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare function kebabToCamel(kebab: string, capitalize?: boolean): string;
|
|
2
|
-
export declare function camelToKebab(camelCaseString: string): string;
|
|
3
|
-
export declare function snakeToDotted(snake: string): string;
|
|
4
|
-
export declare function toPascalCase(str: string): string;
|
|
5
|
-
export declare function capitalize(string: string, everyWord?: boolean): string;
|
|
6
|
-
export declare function uncapitalize(string: string, everyWord?: boolean): string;
|
|
7
|
-
export declare function generateId(length: number, characters?: string): string;
|
|
8
|
-
export declare function isUppercase(string: string): boolean;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type Axes2D = 'x' | 'y';
|
|
2
|
-
export type Axes3D = Axes2D | 'z';
|
|
3
|
-
export type Dot2D = {
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
};
|
|
7
|
-
export type Dimension2D = {
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
};
|
|
11
|
-
export type Rect2D = Dot2D & Dimension2D;
|
|
12
|
-
export type Circle = Dot2D & {
|
|
13
|
-
radius: number;
|
|
14
|
-
};
|
|
15
|
-
export type Dot3D = Dot2D & {
|
|
16
|
-
z: number;
|
|
17
|
-
};
|
|
18
|
-
export type Rect3D = Rect2D & {
|
|
19
|
-
depth: number;
|
|
20
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export type NestedKeys<T> = T extends Node ? '' : T extends object ? {
|
|
2
|
-
[K in keyof T]: T[K] extends infer U ? `${Extract<K, string>}${NestedKeys<U> extends '' ? '' : '.'}${NestedKeys<U>}` : never;
|
|
3
|
-
}[keyof T] : '';
|
|
4
|
-
export type NestedValueOf<Obj, Key extends string> = Obj extends object ? Key extends `${infer Parent}.${infer Leaf}` ? Parent extends keyof Obj ? NestedValueOf<Obj[Parent], Leaf> : never : Key extends keyof Obj ? Obj[Key] : never : never;
|
|
5
|
-
export type Tail<T extends any[]> = ((...t: T) => void) extends (h: any, ...r: infer R) => void ? R : never;
|
|
6
|
-
export type DeepOmit<T, Path extends string[]> = T extends object ? Path['length'] extends 1 ? Omit<T, Path[0]> : {
|
|
7
|
-
[K in keyof T]: K extends Path[0] ? DeepOmit<T[K], Tail<Path>> : T[K];
|
|
8
|
-
} : T;
|
|
9
|
-
export type DeepPartial<T> = {
|
|
10
|
-
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
11
|
-
};
|
|
12
|
-
export type Requiredish<T> = {
|
|
13
|
-
[K in keyof Required<T>]: T[K];
|
|
14
|
-
};
|
|
15
|
-
export type WithRequired<T, K extends keyof T> = T & {
|
|
16
|
-
[P in K]-?: T[P];
|
|
17
|
-
};
|
|
18
|
-
export type Split<S extends string, D extends string> = string extends S ? string[] : S extends '' ? [] : S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
|
|
19
|
-
export type SplitFirst<S extends string, D extends string> = string extends S ? string[] : S extends '' ? [] : S extends `${infer T}${D}${infer U}` ? [T, U] : [S];
|
|
20
|
-
export type KebabToCamel<S extends string> = S extends `${infer T}-${infer U}` ? `${T}${Capitalize<KebabToCamel<U>>}` : S;
|
|
21
|
-
export type CamelToKebab<S extends string> = S extends `${infer T}${infer U}` ? U extends Uncapitalize<U> ? `${Uncapitalize<T>}${CamelToKebab<U>}` : `${Uncapitalize<T>}-${CamelToKebab<U>}` : '';
|
|
22
|
-
export type UndefIndex<T extends any[], I extends number> = {
|
|
23
|
-
[P in keyof T]: P extends Exclude<keyof T, keyof any[]> ? P extends `${I}` ? undefined : T[P] : T[P];
|
|
24
|
-
};
|
|
25
|
-
export type FilterUndefined<T extends any[]> = T extends [] ? [] : T extends [infer H, ...infer R] ? H extends undefined ? FilterUndefined<R> : [H, ...FilterUndefined<R>] : T;
|
|
26
|
-
export type SpliceTuple<T extends any[], I extends number> = FilterUndefined<UndefIndex<T, I>>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare function splitPath(value: string, base?: string): {
|
|
2
|
-
leaf: string;
|
|
3
|
-
pathname: string;
|
|
4
|
-
parameters: string;
|
|
5
|
-
hash: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function normalizeBase(base: string): string;
|
|
8
|
-
export type ChangeHistoryAction = 'replace' | 'push' | 'none';
|
|
9
|
-
export declare function changeHistory(action: ChangeHistoryAction, pathname: string, parameters?: string | undefined, hash?: string | undefined): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var l=(t,s,e)=>{if(!s.has(t))throw TypeError("Cannot "+e)};var i=(t,s,e)=>(l(t,s,"read from private field"),e?e.call(t):s.get(t)),n=(t,s,e)=>{if(s.has(t))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(t):s.set(t,e)},c=(t,s,e,o)=>(l(t,s,"write to private field"),o?o.call(t,e):s.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../window-resizer/index.cjs");require("../Store-Cr3VaD9G.cjs");const h=require("../source/index.cjs"),u=require("../ticker/index.cjs");var r,a;class d extends h.SourceElement{constructor(){super(...arguments);n(this,r,0);n(this,a,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const e=this.consumerElement.readyState/4;e>i(this,r)&&c(this,r,e),this.dispatchEvent(new CustomEvent("readyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:i(this,r)}})),this.consumerElement.readyState===4&&u.ticker.unsubscribe(i(this,a))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{u.ticker.subscribe(i(this,a)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),u.ticker.unsubscribe(i(this,a)),c(this,r,0)}createConsumer(){return document.createElement("video")}consumeSource(e){this.consumerElement.src=e||""}}r=new WeakMap,a=new WeakMap;customElements.get("e-video")||customElements.define("e-video",d);exports.VideoElement=d;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SourceElement } from '../source';
|
|
2
|
-
|
|
3
|
-
export interface ReadyStateChangeEventDetail {
|
|
4
|
-
readyState: number;
|
|
5
|
-
progress: number;
|
|
6
|
-
}
|
|
7
|
-
export type ReadyStateChangeEvent = CustomEvent<ReadyStateChangeEventDetail>;
|
|
8
|
-
export declare class VideoElement extends SourceElement<HTMLVideoElement> {
|
|
9
|
-
#private;
|
|
10
|
-
protected connectedCallback(): void;
|
|
11
|
-
protected disconnectedCallback(): void;
|
|
12
|
-
protected createConsumer(): HTMLVideoElement;
|
|
13
|
-
protected consumeSource(url: string | null): void;
|
|
14
|
-
}
|
|
15
|
-
declare global {
|
|
16
|
-
interface HTMLElementTagNameMap {
|
|
17
|
-
'e-video': VideoElement;
|
|
18
|
-
}
|
|
19
|
-
interface HTMLElementEventMap {
|
|
20
|
-
readyStateChange: ReadyStateChangeEvent;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var c=(e,i,s)=>{if(!i.has(e))throw TypeError("Cannot "+s)};var n=(e,i,s)=>(c(e,i,"read from private field"),s?s.call(e):i.get(e)),d=(e,i,s)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,s)},w=(e,i,s,o)=>(c(e,i,"write to private field"),o?o.call(e,s):i.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../notifier/index.cjs"),a=require("../browser-CpzFX2xg.cjs"),h=require("../function-MthRj-GJ.cjs"),v=h.debounce(e=>{e?window.dispatchEvent(new CustomEvent("resize",{detail:{cause:e}})):window.dispatchEvent(new Event("resize"))},0);var t,r,u;class z extends b.Notifier{constructor(){super();d(this,t,!1);d(this,r,()=>{n(this,t)||(w(this,t,!0),n(this,u).call(this))});d(this,u,h.debounce(()=>{this.notify(),w(this,t,!1)},0));a.isBrowser&&(window.addEventListener("resize",n(this,r)),n(this,r).call(this))}subscribe(s,o){const f=super.subscribe(s,o);return n(this,t)||s(),f}}t=new WeakMap,r=new WeakMap,u=new WeakMap;const l=new z;exports.WindowResizer=z;exports.dispatchWindowResizeEvent=v;exports.windowResizer=l;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Notifier } from '../notifier';
|
|
2
|
-
|
|
3
|
-
export type WindowResizerCallback = () => void;
|
|
4
|
-
export declare const dispatchWindowResizeEvent: (cause?: any) => void;
|
|
5
|
-
export declare class WindowResizer extends Notifier<WindowResizerCallback> {
|
|
6
|
-
#private;
|
|
7
|
-
constructor();
|
|
8
|
-
subscribe(callback: WindowResizerCallback, order?: number): () => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const windowResizer: WindowResizer;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var f = (e, i, s) => {
|
|
2
|
-
if (!i.has(e))
|
|
3
|
-
throw TypeError("Cannot " + s);
|
|
4
|
-
};
|
|
5
|
-
var r = (e, i, s) => (f(e, i, "read from private field"), s ? s.call(e) : i.get(e)), d = (e, i, s) => {
|
|
6
|
-
if (i.has(e))
|
|
7
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
-
i instanceof WeakSet ? i.add(e) : i.set(e, s);
|
|
9
|
-
}, h = (e, i, s, o) => (f(e, i, "write to private field"), o ? o.call(e, s) : i.set(e, s), s);
|
|
10
|
-
import { Notifier as p } from "../notifier/index.js";
|
|
11
|
-
import { i as z } from "../browser-0zX67oeU.js";
|
|
12
|
-
import { d as u } from "../function-C10DGppn.js";
|
|
13
|
-
const l = u((e) => {
|
|
14
|
-
e ? window.dispatchEvent(
|
|
15
|
-
new CustomEvent("resize", {
|
|
16
|
-
detail: {
|
|
17
|
-
cause: e
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
) : window.dispatchEvent(new Event("resize"));
|
|
21
|
-
}, 0);
|
|
22
|
-
var t, n, w;
|
|
23
|
-
class a extends p {
|
|
24
|
-
constructor() {
|
|
25
|
-
super();
|
|
26
|
-
d(this, t, !1);
|
|
27
|
-
d(this, n, () => {
|
|
28
|
-
r(this, t) || (h(this, t, !0), r(this, w).call(this));
|
|
29
|
-
});
|
|
30
|
-
d(this, w, u(() => {
|
|
31
|
-
this.notify(), h(this, t, !1);
|
|
32
|
-
}, 0));
|
|
33
|
-
z && (window.addEventListener("resize", r(this, n)), r(this, n).call(this));
|
|
34
|
-
}
|
|
35
|
-
subscribe(s, o) {
|
|
36
|
-
const c = super.subscribe(s, o);
|
|
37
|
-
return r(this, t) || s(), c;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
t = new WeakMap(), n = new WeakMap(), w = new WeakMap();
|
|
41
|
-
const R = new a();
|
|
42
|
-
export {
|
|
43
|
-
a as WindowResizer,
|
|
44
|
-
l as dispatchWindowResizeEvent,
|
|
45
|
-
R as windowResizer
|
|
46
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as Ffmpeg } from 'fluent-ffmpeg';
|
|
2
|
-
import { Output } from '../utils';
|
|
3
|
-
|
|
4
|
-
export interface FFmpegParameters {
|
|
5
|
-
inputPath: string;
|
|
6
|
-
outputPath?: string;
|
|
7
|
-
fileContent: Buffer;
|
|
8
|
-
instructions?: (command: Ffmpeg.FfmpegCommand) => void | Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
export declare function FFmpeg({ inputPath, outputPath, fileContent, instructions, }: FFmpegParameters): Promise<Output>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { FFmpeg, type FFmpegParameters } from './FFmpeg';
|
|
2
|
-
export { generateFavicon } from './generateFavicon';
|
|
3
|
-
export { generateSequence } from './generateSequence';
|
|
4
|
-
export { generateSprite } from './generateSprite';
|
|
5
|
-
export { inputFiles, type InputFilesParameters, type InputFilesSettings, type InputsFilesCallbackFaviconParameters, type InputsFilesCallbackDefaultParameters, type InputFilesCallback, type InputFilesCallbackEntry, } from './inputFiles';
|
|
6
|
-
export { optimize, type OptimizeOptions, type OptimizeProgressCallback, type OptimizeProgress, } from './optimize';
|
|
7
|
-
export { optimizeImage } from './optimizeImage';
|
|
8
|
-
export { optimizer } from './optimizer';
|
|
9
|
-
export { optimizeVideo } from './optimizeVideo';
|
|
10
|
-
export { type SourceDefaultSettings, type Source, type SkipSource, type ImageSource, type VideoSource, type FaviconSource, type SpriteSource, type SequenceSource, type KnownSource, ALLOWED_IMAGE_EXTENSIONS, ALLOWED_VIDEO_EXTENSIONS, } from './types';
|
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
import { mkdir, readFile, readdir } from "fs/promises";
|
|
2
|
-
import { dirname, join, sep, extname } from "path";
|
|
3
|
-
import Ffmpeg from "fluent-ffmpeg";
|
|
4
|
-
import { getTmpPath, outputFile, getFolderFiles, removeExtension, clear, getBuffer, clamp, replaceExtension, outputFiles } from "../utils/index.js";
|
|
5
|
-
import favicons from "favicons";
|
|
6
|
-
import { parse } from "node-html-parser";
|
|
7
|
-
import { statSync } from "fs";
|
|
8
|
-
import sharp from "sharp";
|
|
9
|
-
import "crypto";
|
|
10
|
-
async function FFmpeg({
|
|
11
|
-
inputPath,
|
|
12
|
-
outputPath,
|
|
13
|
-
fileContent,
|
|
14
|
-
instructions
|
|
15
|
-
}) {
|
|
16
|
-
return new Promise(async (resolve, reject) => {
|
|
17
|
-
const tmpInputPath = getTmpPath(inputPath);
|
|
18
|
-
const tmpOutputPath = getTmpPath(outputPath || inputPath);
|
|
19
|
-
await outputFile(tmpInputPath, fileContent);
|
|
20
|
-
await mkdir(dirname(tmpOutputPath), { recursive: true });
|
|
21
|
-
const command = Ffmpeg(tmpInputPath);
|
|
22
|
-
await (instructions == null ? void 0 : instructions(command));
|
|
23
|
-
command.on("end", async () => {
|
|
24
|
-
if (outputPath) {
|
|
25
|
-
const folderPath = dirname(tmpOutputPath);
|
|
26
|
-
const files = await getFolderFiles(folderPath);
|
|
27
|
-
const output = files.map((file) => {
|
|
28
|
-
return {
|
|
29
|
-
data: file.buffer,
|
|
30
|
-
destinationPath: join(
|
|
31
|
-
removeExtension(inputPath),
|
|
32
|
-
`${file.name.split(".").slice(0, -1)}${file.ext}`
|
|
33
|
-
)
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
await clear(tmpInputPath, folderPath);
|
|
37
|
-
resolve(output);
|
|
38
|
-
} else {
|
|
39
|
-
const file = await readFile(tmpOutputPath);
|
|
40
|
-
await clear(tmpInputPath, tmpOutputPath);
|
|
41
|
-
const output = [
|
|
42
|
-
{
|
|
43
|
-
data: file,
|
|
44
|
-
destinationPath: inputPath
|
|
45
|
-
}
|
|
46
|
-
];
|
|
47
|
-
resolve(output);
|
|
48
|
-
}
|
|
49
|
-
}).on("error", async (e) => {
|
|
50
|
-
await clear(tmpInputPath, tmpOutputPath);
|
|
51
|
-
reject(e);
|
|
52
|
-
}).output(tmpOutputPath).run();
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
async function generateFavicon(source) {
|
|
56
|
-
const output = [];
|
|
57
|
-
const { settings } = source;
|
|
58
|
-
const buffer = await getBuffer(source.content);
|
|
59
|
-
const response = await favicons(buffer, settings);
|
|
60
|
-
output.push(
|
|
61
|
-
...[...response.images, ...response.files].map((item) => {
|
|
62
|
-
return {
|
|
63
|
-
destinationPath: join(settings.destinationPath, item.name),
|
|
64
|
-
data: item.contents
|
|
65
|
-
};
|
|
66
|
-
})
|
|
67
|
-
);
|
|
68
|
-
output.push({
|
|
69
|
-
destinationPath: settings.destinationHtmlPath,
|
|
70
|
-
data: response.html.join("\n")
|
|
71
|
-
});
|
|
72
|
-
return output;
|
|
73
|
-
}
|
|
74
|
-
async function generateSequence(source) {
|
|
75
|
-
const { settings } = source;
|
|
76
|
-
const buffer = await getBuffer(source.content);
|
|
77
|
-
return FFmpeg({
|
|
78
|
-
inputPath: settings.destinationPath,
|
|
79
|
-
outputPath: `${removeExtension(settings.destinationPath)}/frame-%04d.${settings.frameExtension || "jpg"}`,
|
|
80
|
-
fileContent: buffer,
|
|
81
|
-
instructions: (command) => {
|
|
82
|
-
if (settings.fps) {
|
|
83
|
-
command.addOutputOption([`-r ${Math.max(1, settings.fps | 0)}`]);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
async function generateSprite(source) {
|
|
89
|
-
const output = [];
|
|
90
|
-
const { settings } = source;
|
|
91
|
-
const spriteName = source.settings.name || "sprite";
|
|
92
|
-
const svgOpenTag = `<svg id="${spriteName}" xmlns="http://www.w3.org/2000/svg">`;
|
|
93
|
-
const svgCloseTag = "</svg>";
|
|
94
|
-
let spriteString = svgOpenTag;
|
|
95
|
-
for await (const item of source.content) {
|
|
96
|
-
const buffer = await getBuffer(item.data);
|
|
97
|
-
const svgString = buffer.toString();
|
|
98
|
-
const root = parse(svgString);
|
|
99
|
-
const icon = root.querySelector("svg");
|
|
100
|
-
icon.removeAttribute("width");
|
|
101
|
-
icon.removeAttribute("height");
|
|
102
|
-
if (settings.removeFill) {
|
|
103
|
-
icon.querySelectorAll("*").forEach((child) => {
|
|
104
|
-
child.removeAttribute("fill");
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
if (settings.removeStroke) {
|
|
108
|
-
icon.querySelectorAll("*").forEach((child) => {
|
|
109
|
-
child.removeAttribute("stroke");
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
const symbolOpenTag = `<symbol id="${`${spriteName}:${item.name}`}" viewBox="${icon.getAttribute(
|
|
113
|
-
"viewBox"
|
|
114
|
-
)}">`;
|
|
115
|
-
const symbolContent = icon.innerHTML;
|
|
116
|
-
const symbolCloseTag = `</symbol>`;
|
|
117
|
-
const symbol = symbolOpenTag + symbolContent + symbolCloseTag;
|
|
118
|
-
spriteString += symbol;
|
|
119
|
-
}
|
|
120
|
-
spriteString += svgCloseTag;
|
|
121
|
-
output.push({
|
|
122
|
-
data: spriteString,
|
|
123
|
-
destinationPath: source.settings.destinationPath
|
|
124
|
-
});
|
|
125
|
-
return output;
|
|
126
|
-
}
|
|
127
|
-
const ALLOWED_IMAGE_EXTENSIONS = ["jpg", "png", "webp", "jpeg"];
|
|
128
|
-
const ALLOWED_VIDEO_EXTENSIONS = ["mp4", "mov"];
|
|
129
|
-
function specialPath(path, specialString) {
|
|
130
|
-
const splitted = path.split("/");
|
|
131
|
-
const left = splitted.slice(0, -1).join("/");
|
|
132
|
-
const leaf = splitted.slice(-1).join("");
|
|
133
|
-
const ext = extname(leaf);
|
|
134
|
-
const sourceName = leaf.replace(ext, "");
|
|
135
|
-
const name = sourceName.replace(specialString, "");
|
|
136
|
-
if (name) {
|
|
137
|
-
if (name.startsWith("-")) {
|
|
138
|
-
return `${left}/${name.slice(1)}${ext}`;
|
|
139
|
-
} else {
|
|
140
|
-
return `${left}/${name}${ext}`;
|
|
141
|
-
}
|
|
142
|
-
} else {
|
|
143
|
-
return `${left}/${sourceName.replace("@", "")}${ext}`;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
async function inputFiles({
|
|
147
|
-
sourceFolder,
|
|
148
|
-
destinationFolder,
|
|
149
|
-
settings
|
|
150
|
-
}) {
|
|
151
|
-
var _a, _b, _c, _d, _e;
|
|
152
|
-
let sources = [];
|
|
153
|
-
const currentPaths = await readdir(sourceFolder);
|
|
154
|
-
for await (const currentPath of currentPaths) {
|
|
155
|
-
if (!currentPath.includes(".DS_Store")) {
|
|
156
|
-
const sourcePath = join(sourceFolder, currentPath.toString());
|
|
157
|
-
const destinationPath = join(
|
|
158
|
-
destinationFolder,
|
|
159
|
-
sourcePath.replaceAll(sep, "/").replace(sourceFolder, "")
|
|
160
|
-
);
|
|
161
|
-
if (statSync(sourcePath).isDirectory()) {
|
|
162
|
-
if (sourcePath.includes("@sprite")) {
|
|
163
|
-
const files = await getFolderFiles(sourcePath);
|
|
164
|
-
const content = [];
|
|
165
|
-
files.forEach((file) => {
|
|
166
|
-
if (file.ext === ".svg") {
|
|
167
|
-
content.push({
|
|
168
|
-
name: file.name,
|
|
169
|
-
data: file.buffer
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
const destinationSvgPath = specialPath(
|
|
174
|
-
`${destinationPath}.svg`,
|
|
175
|
-
"@sprite"
|
|
176
|
-
);
|
|
177
|
-
sources.push({
|
|
178
|
-
type: "sprite",
|
|
179
|
-
content,
|
|
180
|
-
settings: {
|
|
181
|
-
destinationPath: destinationSvgPath,
|
|
182
|
-
...(_a = settings == null ? void 0 : settings.sprite) == null ? void 0 : _a.call(settings, {
|
|
183
|
-
destinationPath: destinationSvgPath
|
|
184
|
-
})
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
} else {
|
|
188
|
-
const result = await inputFiles({
|
|
189
|
-
sourceFolder: sourcePath,
|
|
190
|
-
destinationFolder: destinationPath,
|
|
191
|
-
settings
|
|
192
|
-
});
|
|
193
|
-
sources = [...sources, ...result];
|
|
194
|
-
}
|
|
195
|
-
} else {
|
|
196
|
-
const ext = extname(destinationPath).toLowerCase().slice(1);
|
|
197
|
-
const content = await readFile(sourcePath);
|
|
198
|
-
if (destinationPath.includes("@favicon")) {
|
|
199
|
-
const destinationFolderPath = specialPath(
|
|
200
|
-
removeExtension(destinationPath),
|
|
201
|
-
"@favicon"
|
|
202
|
-
);
|
|
203
|
-
const destinationHtmlPath = `${destinationFolderPath}/head.html`;
|
|
204
|
-
sources.push({
|
|
205
|
-
content,
|
|
206
|
-
type: "favicon",
|
|
207
|
-
settings: {
|
|
208
|
-
destinationPath: destinationFolderPath,
|
|
209
|
-
destinationHtmlPath,
|
|
210
|
-
...(_b = settings == null ? void 0 : settings.favicon) == null ? void 0 : _b.call(settings, {
|
|
211
|
-
destinationPath: destinationFolderPath,
|
|
212
|
-
destinationHtmlPath
|
|
213
|
-
})
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
} else if (destinationPath.includes("@sequence")) {
|
|
217
|
-
const path = specialPath(destinationPath, "@sequence");
|
|
218
|
-
sources.push({
|
|
219
|
-
content,
|
|
220
|
-
type: "sequence",
|
|
221
|
-
settings: {
|
|
222
|
-
destinationPath: path,
|
|
223
|
-
...(_c = settings == null ? void 0 : settings.sequence) == null ? void 0 : _c.call(settings, { destinationPath: path })
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
} else if (ALLOWED_IMAGE_EXTENSIONS.includes(
|
|
227
|
-
ext
|
|
228
|
-
)) {
|
|
229
|
-
sources.push({
|
|
230
|
-
content,
|
|
231
|
-
type: "image",
|
|
232
|
-
settings: {
|
|
233
|
-
placeholder: false,
|
|
234
|
-
quality: 80,
|
|
235
|
-
scale: 1,
|
|
236
|
-
webp: false,
|
|
237
|
-
forceJPG: false,
|
|
238
|
-
destinationPath,
|
|
239
|
-
...(_d = settings == null ? void 0 : settings.image) == null ? void 0 : _d.call(settings, { destinationPath })
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
} else if (ALLOWED_VIDEO_EXTENSIONS.includes(
|
|
243
|
-
ext
|
|
244
|
-
)) {
|
|
245
|
-
sources.push({
|
|
246
|
-
content,
|
|
247
|
-
type: "video",
|
|
248
|
-
settings: {
|
|
249
|
-
quality: 80,
|
|
250
|
-
scale: 1,
|
|
251
|
-
fps: 0,
|
|
252
|
-
destinationPath,
|
|
253
|
-
...(_e = settings == null ? void 0 : settings.video) == null ? void 0 : _e.call(settings, { destinationPath })
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
} else {
|
|
257
|
-
sources.push({
|
|
258
|
-
content,
|
|
259
|
-
type: "skip",
|
|
260
|
-
settings: { destinationPath }
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return sources;
|
|
267
|
-
}
|
|
268
|
-
function getNumberSetting(value, min, max) {
|
|
269
|
-
if (typeof value === "number") {
|
|
270
|
-
return clamp(value, min, max);
|
|
271
|
-
}
|
|
272
|
-
return value;
|
|
273
|
-
}
|
|
274
|
-
async function optimizeImage(source) {
|
|
275
|
-
const { settings } = source;
|
|
276
|
-
const content = await getBuffer(source.content);
|
|
277
|
-
const image = sharp(content);
|
|
278
|
-
const meta = await image.metadata();
|
|
279
|
-
const width = meta.width;
|
|
280
|
-
const height = meta.height;
|
|
281
|
-
const output = [];
|
|
282
|
-
const scale = getNumberSetting(settings.scale, 0, 1);
|
|
283
|
-
const quality = getNumberSetting(settings.quality, 0, 100);
|
|
284
|
-
let destinationPath = settings.destinationPath;
|
|
285
|
-
let ext = extname(destinationPath).toLowerCase();
|
|
286
|
-
if (width && height) {
|
|
287
|
-
if (scale) {
|
|
288
|
-
image.resize(Math.floor(width * scale), Math.floor(height * scale));
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
if (ext === ".jpg" || ext === ".jpeg") {
|
|
292
|
-
image.jpeg({
|
|
293
|
-
mozjpeg: true,
|
|
294
|
-
quality
|
|
295
|
-
});
|
|
296
|
-
} else if (ext === ".png") {
|
|
297
|
-
if (settings.forceJPG) {
|
|
298
|
-
const bg = typeof settings.forceJPG === "string" ? settings.forceJPG : "#ffffff";
|
|
299
|
-
image.jpeg({
|
|
300
|
-
mozjpeg: true
|
|
301
|
-
}).flatten({ background: bg });
|
|
302
|
-
destinationPath = replaceExtension(settings.destinationPath, "jpg");
|
|
303
|
-
ext = ".jpg";
|
|
304
|
-
} else {
|
|
305
|
-
image.png({
|
|
306
|
-
compressionLevel: 9,
|
|
307
|
-
adaptiveFiltering: true,
|
|
308
|
-
quality,
|
|
309
|
-
effort: 8
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const buffer = await image.toBuffer();
|
|
314
|
-
output.push({
|
|
315
|
-
data: buffer,
|
|
316
|
-
destinationPath
|
|
317
|
-
});
|
|
318
|
-
if (settings == null ? void 0 : settings.webp) {
|
|
319
|
-
const buffer2 = await image.webp({
|
|
320
|
-
quality,
|
|
321
|
-
effort: 5
|
|
322
|
-
}).toBuffer();
|
|
323
|
-
output.push({
|
|
324
|
-
data: buffer2,
|
|
325
|
-
destinationPath: replaceExtension(destinationPath, "webp")
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
if (settings == null ? void 0 : settings.placeholder) {
|
|
329
|
-
const buffer2 = await image.resize(20, 20).blur(10).toBuffer();
|
|
330
|
-
output.push({
|
|
331
|
-
data: buffer2,
|
|
332
|
-
destinationPath: replaceExtension(destinationPath, `placeholder${ext}`)
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
return output;
|
|
336
|
-
}
|
|
337
|
-
async function optimizeVideo(source) {
|
|
338
|
-
const { settings } = source;
|
|
339
|
-
const buffer = await getBuffer(source.content);
|
|
340
|
-
const quality = getNumberSetting((settings == null ? void 0 : settings.quality) || 80, 0, 100);
|
|
341
|
-
const fps = getNumberSetting((settings == null ? void 0 : settings.fps) || 0, 0, 300);
|
|
342
|
-
const scale = getNumberSetting((settings == null ? void 0 : settings.scale) || 1, 0, 1);
|
|
343
|
-
return FFmpeg({
|
|
344
|
-
inputPath: settings.destinationPath,
|
|
345
|
-
fileContent: buffer,
|
|
346
|
-
instructions: (command) => {
|
|
347
|
-
command.addOutputOption(
|
|
348
|
-
`-crf ${Math.round((100 - quality) * 51 / 100)}`
|
|
349
|
-
);
|
|
350
|
-
if (fps) {
|
|
351
|
-
command.fps(fps);
|
|
352
|
-
}
|
|
353
|
-
command.size(`${scale * 100}%`);
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
async function optimize(sources, options) {
|
|
358
|
-
var _a;
|
|
359
|
-
const output = [];
|
|
360
|
-
let ready = 0;
|
|
361
|
-
for await (const source of sources) {
|
|
362
|
-
if (source.type === "image") {
|
|
363
|
-
output.push(...await optimizeImage(source));
|
|
364
|
-
} else if (source.type === "video") {
|
|
365
|
-
output.push(...await optimizeVideo(source));
|
|
366
|
-
} else if (source.type === "favicon") {
|
|
367
|
-
output.push(...await generateFavicon(source));
|
|
368
|
-
} else if (source.type === "sprite") {
|
|
369
|
-
output.push(...await generateSprite(source));
|
|
370
|
-
} else if (source.type === "sequence") {
|
|
371
|
-
output.push(...await generateSequence(source));
|
|
372
|
-
} else {
|
|
373
|
-
output.push({
|
|
374
|
-
data: await getBuffer(source.content),
|
|
375
|
-
destinationPath: source.settings.destinationPath
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
(_a = options == null ? void 0 : options.onProgress) == null ? void 0 : _a.call(options, {
|
|
379
|
-
ready: ++ready,
|
|
380
|
-
total: sources.length,
|
|
381
|
-
path: source.settings.destinationPath
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
return output;
|
|
385
|
-
}
|
|
386
|
-
async function optimizer(parameters) {
|
|
387
|
-
await clear(parameters.destinationFolder);
|
|
388
|
-
const input = await inputFiles(parameters);
|
|
389
|
-
const optimized = await optimize(input, parameters);
|
|
390
|
-
await outputFiles(optimized);
|
|
391
|
-
}
|
|
392
|
-
export {
|
|
393
|
-
ALLOWED_IMAGE_EXTENSIONS,
|
|
394
|
-
ALLOWED_VIDEO_EXTENSIONS,
|
|
395
|
-
FFmpeg,
|
|
396
|
-
generateFavicon,
|
|
397
|
-
generateSequence,
|
|
398
|
-
generateSprite,
|
|
399
|
-
inputFiles,
|
|
400
|
-
optimize,
|
|
401
|
-
optimizeImage,
|
|
402
|
-
optimizeVideo,
|
|
403
|
-
optimizer
|
|
404
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { FaviconSource, ImageSource, KnownSource, SequenceSource, Source, SpriteSource, VideoSource } from './types';
|
|
2
|
-
|
|
3
|
-
export interface InputFilesCallbackEntry {
|
|
4
|
-
type: KnownSource['type'];
|
|
5
|
-
path: string;
|
|
6
|
-
}
|
|
7
|
-
export type InputFilesCallback<T extends Source> = (entry: InputFilesCallbackEntry) => T;
|
|
8
|
-
export interface InputsFilesCallbackDefaultParameters {
|
|
9
|
-
destinationPath: string;
|
|
10
|
-
}
|
|
11
|
-
export interface InputsFilesCallbackFaviconParameters extends InputsFilesCallbackDefaultParameters {
|
|
12
|
-
destinationHtmlPath: string;
|
|
13
|
-
}
|
|
14
|
-
export interface InputFilesSettings {
|
|
15
|
-
image?(parameters: InputsFilesCallbackDefaultParameters): Partial<ImageSource['settings']>;
|
|
16
|
-
video?(parameters: InputsFilesCallbackDefaultParameters): Partial<VideoSource['settings']>;
|
|
17
|
-
favicon?(parameters: InputsFilesCallbackFaviconParameters): Partial<FaviconSource['settings']>;
|
|
18
|
-
sprite?(parameters: InputsFilesCallbackDefaultParameters): Partial<SpriteSource['settings']>;
|
|
19
|
-
sequence?(parameters: InputsFilesCallbackDefaultParameters): Partial<SequenceSource['settings']>;
|
|
20
|
-
}
|
|
21
|
-
export interface InputFilesParameters {
|
|
22
|
-
sourceFolder: string;
|
|
23
|
-
destinationFolder: string;
|
|
24
|
-
settings?: InputFilesSettings;
|
|
25
|
-
}
|
|
26
|
-
export declare function inputFiles({ sourceFolder, destinationFolder, settings, }: InputFilesParameters): Promise<KnownSource[]>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Output } from '../utils';
|
|
2
|
-
import { KnownSource } from './types';
|
|
3
|
-
|
|
4
|
-
export interface OptimizeProgress {
|
|
5
|
-
ready: number;
|
|
6
|
-
total: number;
|
|
7
|
-
path: string;
|
|
8
|
-
}
|
|
9
|
-
export type OptimizeProgressCallback = (progress: OptimizeProgress) => void;
|
|
10
|
-
export interface OptimizeOptions {
|
|
11
|
-
onProgress?: OptimizeProgressCallback;
|
|
12
|
-
}
|
|
13
|
-
export declare function optimize(sources: Array<KnownSource>, options?: OptimizeOptions): Promise<Output>;
|