@imgly/codesign-mcp 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -1
- package/assets/docs/guide/SKILL.md +45 -53
- package/assets/docs/guide/animation/create/base.md +234 -243
- package/assets/docs/guide/animation/create/text.md +250 -231
- package/assets/docs/guide/animation/create.md +197 -231
- package/assets/docs/guide/animation/edit.md +196 -271
- package/assets/docs/guide/animation/types.md +182 -185
- package/assets/docs/guide/animation.md +9 -6
- package/assets/docs/guide/api/AssetAPI.md +7 -53
- package/assets/docs/guide/api/BlockAPI.md +725 -648
- package/assets/docs/guide/api/CreativeEngine.md +7 -16
- package/assets/docs/guide/api/EditorAPI.md +32 -93
- package/assets/docs/guide/api/EventAPI.md +1 -2
- package/assets/docs/guide/api/SceneAPI.md +47 -98
- package/assets/docs/guide/api/VariableAPI.md +1 -4
- package/assets/docs/guide/api/node/classes/assetapi.md +1090 -0
- package/assets/docs/guide/api/node/classes/blockapi.md +12965 -0
- package/assets/docs/guide/api/node/classes/creativeengine.md +319 -0
- package/assets/docs/guide/api/node/classes/editorapi.md +3417 -0
- package/assets/docs/guide/api/node/classes/engineactions.md +319 -0
- package/assets/docs/guide/api/node/classes/eventapi.md +56 -0
- package/assets/docs/guide/api/node/classes/sceneapi.md +1370 -0
- package/assets/docs/guide/api/node/classes/variableapi.md +143 -0
- package/assets/docs/guide/api/node/enumerations/compressionformat.md +23 -0
- package/assets/docs/guide/api/node/enumerations/compressionlevel.md +24 -0
- package/assets/docs/guide/api/node/functions/iscmykcolor.md +30 -0
- package/assets/docs/guide/api/node/functions/isrgbacolor.md +30 -0
- package/assets/docs/guide/api/node/functions/isspotcolor.md +30 -0
- package/assets/docs/guide/api/node/interfaces/addvideooptions.md +31 -0
- package/assets/docs/guide/api/node/interfaces/applyassetoptions.md +31 -0
- package/assets/docs/guide/api/node/interfaces/asset.md +30 -0
- package/assets/docs/guide/api/node/interfaces/assetbooleanproperty.md +25 -0
- package/assets/docs/guide/api/node/interfaces/assetcmykcolor.md +26 -0
- package/assets/docs/guide/api/node/interfaces/assetcolorproperty.md +25 -0
- package/assets/docs/guide/api/node/interfaces/assetcontentaspectratio.md +23 -0
- package/assets/docs/guide/api/node/interfaces/assetdefinition.md +31 -0
- package/assets/docs/guide/api/node/interfaces/assetenumproperty.md +26 -0
- package/assets/docs/guide/api/node/interfaces/assetfixedaspectratio.md +24 -0
- package/assets/docs/guide/api/node/interfaces/assetfixedsize.md +25 -0
- package/assets/docs/guide/api/node/interfaces/assetfreeaspectratio.md +22 -0
- package/assets/docs/guide/api/node/interfaces/assetnumberproperty.md +28 -0
- package/assets/docs/guide/api/node/interfaces/assetpayload.md +27 -0
- package/assets/docs/guide/api/node/interfaces/assetquerydata.md +32 -0
- package/assets/docs/guide/api/node/interfaces/assetresult.md +46 -0
- package/assets/docs/guide/api/node/interfaces/assetrgbcolor.md +25 -0
- package/assets/docs/guide/api/node/interfaces/assetsource.md +111 -0
- package/assets/docs/guide/api/node/interfaces/assetspotcolor.md +25 -0
- package/assets/docs/guide/api/node/interfaces/assetsqueryresult.md +31 -0
- package/assets/docs/guide/api/node/interfaces/assetstringproperty.md +25 -0
- package/assets/docs/guide/api/node/interfaces/assetstylepreset.md +39 -0
- package/assets/docs/guide/api/node/interfaces/assetstylepresetanimation.md +23 -0
- package/assets/docs/guide/api/node/interfaces/audiotrackinfo.md +32 -0
- package/assets/docs/guide/api/node/interfaces/blockevent.md +26 -0
- package/assets/docs/guide/api/node/interfaces/blockstateerror.md +26 -0
- package/assets/docs/guide/api/node/interfaces/blockstatepending.md +26 -0
- package/assets/docs/guide/api/node/interfaces/blockstateready.md +25 -0
- package/assets/docs/guide/api/node/interfaces/buffer.md +26 -0
- package/assets/docs/guide/api/node/interfaces/characterinkbox.md +29 -0
- package/assets/docs/guide/api/node/interfaces/cmykcolor.md +34 -0
- package/assets/docs/guide/api/node/interfaces/completeassetresult.md +46 -0
- package/assets/docs/guide/api/node/interfaces/configuration.md +38 -0
- package/assets/docs/guide/api/node/interfaces/dominantcolor.md +25 -0
- package/assets/docs/guide/api/node/interfaces/dominantcolorsoptions.md +23 -0
- package/assets/docs/guide/api/node/interfaces/engineactioninfo.md +24 -0
- package/assets/docs/guide/api/node/interfaces/engineactionsregistry.md +18 -0
- package/assets/docs/guide/api/node/interfaces/engineplugin.md +30 -0
- package/assets/docs/guide/api/node/interfaces/font.md +27 -0
- package/assets/docs/guide/api/node/interfaces/fontmetrics.md +32 -0
- package/assets/docs/guide/api/node/interfaces/gradientcolorstop.md +28 -0
- package/assets/docs/guide/api/node/interfaces/logger.md +39 -0
- package/assets/docs/guide/api/node/interfaces/pageduration.md +23 -0
- package/assets/docs/guide/api/node/interfaces/range.md +23 -0
- package/assets/docs/guide/api/node/interfaces/rgbacolor.md +32 -0
- package/assets/docs/guide/api/node/interfaces/rgbcolor.md +30 -0
- package/assets/docs/guide/api/node/interfaces/settings.md +126 -0
- package/assets/docs/guide/api/node/interfaces/size2.md +21 -0
- package/assets/docs/guide/api/node/interfaces/source.md +24 -0
- package/assets/docs/guide/api/node/interfaces/spotcolor.md +30 -0
- package/assets/docs/guide/api/node/interfaces/textdecorationconfig.md +31 -0
- package/assets/docs/guide/api/node/interfaces/textfontsizeoptions.md +24 -0
- package/assets/docs/guide/api/node/interfaces/textruninfo.md +33 -0
- package/assets/docs/guide/api/node/interfaces/transientresource.md +26 -0
- package/assets/docs/guide/api/node/interfaces/typeface.md +23 -0
- package/assets/docs/guide/api/node/interfaces/vec2.md +21 -0
- package/assets/docs/guide/api/node/interfaces/vec3.md +22 -0
- package/assets/docs/guide/api/node/type-aliases/addimageoptions.md +36 -0
- package/assets/docs/guide/api/node/type-aliases/animationbaselinedirection.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationblockswipetextdirection.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationeasing.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationentry.md +28 -0
- package/assets/docs/guide/api/node/type-aliases/animationgrowdirection.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationjumploopdirection.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationkenburnsdirection.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationmergetextdirection.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationoptions.md +28 -0
- package/assets/docs/guide/api/node/type-aliases/animationspindirection.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationspinloopdirection.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationtype.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/animationtypelonghand.md +21 -0
- package/assets/docs/guide/api/node/type-aliases/animationtypeshorthand.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationtypewritertextwritingstyle.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/animationwipedirection.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/applicationmimetype.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/assetcolor.md +23 -0
- package/assets/docs/guide/api/node/type-aliases/assetfilter.md +47 -0
- package/assets/docs/guide/api/node/type-aliases/assetgroups.md +25 -0
- package/assets/docs/guide/api/node/type-aliases/assetmetadata.md +42 -0
- package/assets/docs/guide/api/node/type-aliases/assetproperty.md +25 -0
- package/assets/docs/guide/api/node/type-aliases/assetpropertyfilter.md +41 -0
- package/assets/docs/guide/api/node/type-aliases/assetpropertypath.md +26 -0
- package/assets/docs/guide/api/node/type-aliases/assetstylepresetanimationproperties.md +34 -0
- package/assets/docs/guide/api/node/type-aliases/assetstylepresetproperties.md +29 -0
- package/assets/docs/guide/api/node/type-aliases/assetstylepresetpropertyvalue.md +29 -0
- package/assets/docs/guide/api/node/type-aliases/assetstylepresetscalableproperty.md +28 -0
- package/assets/docs/guide/api/node/type-aliases/assettransformpreset.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/asyncuriresolver.md +36 -0
- package/assets/docs/guide/api/node/type-aliases/audioexportoptions.md +43 -0
- package/assets/docs/guide/api/node/type-aliases/audiofromvideooptions.md +27 -0
- package/assets/docs/guide/api/node/type-aliases/audiomimetype.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/blendmode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/blockenumtype.md +63 -0
- package/assets/docs/guide/api/node/type-aliases/blockstate.md +26 -0
- package/assets/docs/guide/api/node/type-aliases/blurtype.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/blurtypelonghand.md +21 -0
- package/assets/docs/guide/api/node/type-aliases/blurtypeshorthand.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/booleanoperation.md +27 -0
- package/assets/docs/guide/api/node/type-aliases/boolpropertyname.md +79 -0
- package/assets/docs/guide/api/node/type-aliases/cameraclampingovershootmode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/captionhorizontalalignment.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/captionverticalalignment.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/cmyk.md +23 -0
- package/assets/docs/guide/api/node/type-aliases/color.md +23 -0
- package/assets/docs/guide/api/node/type-aliases/colorpickercolormode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/colorpropertyname.md +31 -0
- package/assets/docs/guide/api/node/type-aliases/colorspace.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/contentfillmode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/controlgizmomovehandlevisibility.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/controlgizmoresizehandlesvisibility.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/controlgizmorotatehandlesvisibility.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/controlgizmoscalehandlesvisibility.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/createsceneoptions.md +30 -0
- package/assets/docs/guide/api/node/type-aliases/cutoutoperation.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/cutouttype.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/defaultassetsourceid.md +37 -0
- package/assets/docs/guide/api/node/type-aliases/demoassetsourceid.md +33 -0
- package/assets/docs/guide/api/node/type-aliases/designblockid.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/designblocktype.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/designblocktypelonghand.md +21 -0
- package/assets/docs/guide/api/node/type-aliases/designblocktypeshorthand.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/designunit.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/doubleclickselectionmode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/doublepropertyname.md +26 -0
- package/assets/docs/guide/api/node/type-aliases/dropshadowoptions.md +32 -0
- package/assets/docs/guide/api/node/type-aliases/editmode.md +27 -0
- package/assets/docs/guide/api/node/type-aliases/effecttype.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/effecttypelonghand.md +21 -0
- package/assets/docs/guide/api/node/type-aliases/effecttypeshorthand.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/engineactionid.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/enginecustomactionfunction.md +30 -0
- package/assets/docs/guide/api/node/type-aliases/engineplugincontext.md +30 -0
- package/assets/docs/guide/api/node/type-aliases/enumpropertyname.md +59 -0
- package/assets/docs/guide/api/node/type-aliases/enumvalues.md +59 -0
- package/assets/docs/guide/api/node/type-aliases/exportoptions.md +57 -0
- package/assets/docs/guide/api/node/type-aliases/fillpixelstreamorientation.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/filltype.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/filltypelonghand.md +21 -0
- package/assets/docs/guide/api/node/type-aliases/filltypeshorthand.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/floatpropertyname.md +184 -0
- package/assets/docs/guide/api/node/type-aliases/fontsizeunit.md +23 -0
- package/assets/docs/guide/api/node/type-aliases/fontstyle.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/fontweight.md +30 -0
- package/assets/docs/guide/api/node/type-aliases/gradientstoprgba.md +23 -0
- package/assets/docs/guide/api/node/type-aliases/heightmode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/hexcolorstring.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/historyid.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/historyupdate.md +25 -0
- package/assets/docs/guide/api/node/type-aliases/horizontalblockalignment.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/horizontalcontentfillalignment.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/horizontaltextalignment.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/imagemimetype.md +25 -0
- package/assets/docs/guide/api/node/type-aliases/intpropertyname.md +26 -0
- package/assets/docs/guide/api/node/type-aliases/liststyle.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/locale.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/loglevel.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/mimetype.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/objecttype.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/objecttypelonghand.md +27 -0
- package/assets/docs/guide/api/node/type-aliases/objecttypeshorthand.md +27 -0
- package/assets/docs/guide/api/node/type-aliases/optionalprefix.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/pageguidessource.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/palettecolor.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/positionmode.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/positionxmode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/positionymode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/propertytype.md +31 -0
- package/assets/docs/guide/api/node/type-aliases/rgba.md +23 -0
- package/assets/docs/guide/api/node/type-aliases/rolestring.md +23 -0
- package/assets/docs/guide/api/node/type-aliases/scenefontsizeunit.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/scenelayout.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/scenemode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/scope.md +50 -0
- package/assets/docs/guide/api/node/type-aliases/settingboolpropertyname.md +62 -0
- package/assets/docs/guide/api/node/type-aliases/settingcolorpropertyname.md +38 -0
- package/assets/docs/guide/api/node/type-aliases/settingenumpropertyname.md +29 -0
- package/assets/docs/guide/api/node/type-aliases/settingenumtype.md +33 -0
- package/assets/docs/guide/api/node/type-aliases/settingenumvalues.md +29 -0
- package/assets/docs/guide/api/node/type-aliases/settingfloatpropertyname.md +25 -0
- package/assets/docs/guide/api/node/type-aliases/settingintpropertyname.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/settingkey.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/settingsbool.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/settingscolor.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/settingscolorrgba.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/settingsenum.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/settingsfloat.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/settingsint.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/settingsstring.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/settingstringpropertyname.md +28 -0
- package/assets/docs/guide/api/node/type-aliases/settingtype.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/settingvaluetype.md +26 -0
- package/assets/docs/guide/api/node/type-aliases/shapetype.md +24 -0
- package/assets/docs/guide/api/node/type-aliases/shapetypelonghand.md +21 -0
- package/assets/docs/guide/api/node/type-aliases/shapetypeshorthand.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/shapevectorpathfillrule.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/sizemode.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/sortingorder.md +21 -0
- package/assets/docs/guide/api/node/type-aliases/sourcesetpropertyname.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/splitoptions.md +28 -0
- package/assets/docs/guide/api/node/type-aliases/stringpropertyname.md +43 -0
- package/assets/docs/guide/api/node/type-aliases/strokecap.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/strokecornergeometry.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/strokedashendcap.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/strokedashstartcap.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/strokeendcap.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/strokeposition.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/strokestartcap.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/strokestyle.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/syncuriresolver.md +31 -0
- package/assets/docs/guide/api/node/type-aliases/textanimationwritingstyle.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/textcase.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/textdecorationline.md +27 -0
- package/assets/docs/guide/api/node/type-aliases/textdecorationstyle.md +26 -0
- package/assets/docs/guide/api/node/type-aliases/textverticalalignment.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/timelinetrackvisibility.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/touchpinchaction.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/touchrotateaction.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/typefacedefinition.md +41 -0
- package/assets/docs/guide/api/node/type-aliases/verticalblockalignment.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/verticalcontentfillalignment.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/videoexportoptions.md +54 -0
- package/assets/docs/guide/api/node/type-aliases/videomimetype.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/widthmode.md +18 -0
- package/assets/docs/guide/api/node/type-aliases/xywh.md +23 -0
- package/assets/docs/guide/api/node/type-aliases/zoomautofitaxis.md +20 -0
- package/assets/docs/guide/api/node/type-aliases/zoomoptions.md +27 -0
- package/assets/docs/guide/api/node/variables/animation_types.md +21 -0
- package/assets/docs/guide/api/node/variables/animationbaselinedirectionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationblockswipetextdirectionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationeasingvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationgrowdirectionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationjumploopdirectionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationkenburnsdirectionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationmergetextdirectionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationspindirectionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationspinloopdirectionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationtypewritertextwritingstylevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/animationwipedirectionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/blendmodevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/blur_types.md +21 -0
- package/assets/docs/guide/api/node/variables/cameraclampingovershootmodevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/captionhorizontalalignmentvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/captionverticalalignmentvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/colorpickercolormodevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/contentfillmodevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/controlgizmomovehandlevisibilityvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/controlgizmoresizehandlesvisibilityvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/controlgizmorotatehandlesvisibilityvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/controlgizmoscalehandlesvisibilityvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/cutouttypevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/design_block_types.md +21 -0
- package/assets/docs/guide/api/node/variables/doubleclickselectionmodevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/effect_types.md +21 -0
- package/assets/docs/guide/api/node/variables/fill_types.md +21 -0
- package/assets/docs/guide/api/node/variables/fillpixelstreamorientationvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/heightmodevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/horizontalcontentfillalignmentvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/loglevel.md +37 -0
- package/assets/docs/guide/api/node/variables/mimetype.md +41 -0
- package/assets/docs/guide/api/node/variables/pageguidessourcevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/positionxmodevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/positionymodevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/scenedesignunitvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/scenefontsizeunitvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/scenelayoutvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/scenemodevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/shape_types.md +21 -0
- package/assets/docs/guide/api/node/variables/shapevectorpathfillrulevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/strokecapvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/strokecornergeometryvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/strokedashendcapvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/strokedashstartcapvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/strokeendcapvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/strokepositionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/strokestartcapvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/strokestylevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/textanimationwritingstylevalues.md +18 -0
- package/assets/docs/guide/api/node/variables/texthorizontalalignmentvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/textverticalalignmentvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/timelinetrackvisibilityvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/touchpinchactionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/touchrotateactionvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/verticalcontentfillalignmentvalues.md +18 -0
- package/assets/docs/guide/api/node/variables/widthmodevalues.md +18 -0
- package/assets/docs/guide/api/types.md +5 -9
- package/assets/docs/guide/api-reference/overview.md +7 -7
- package/assets/docs/guide/automation/auto-resize.md +263 -300
- package/assets/docs/guide/automation/data-merge.md +246 -275
- package/assets/docs/guide/automation/design-generation.md +102 -31
- package/assets/docs/guide/automation/multi-image-generation.md +758 -0
- package/assets/docs/guide/automation/overview.md +21 -4
- package/assets/docs/guide/automation.md +10 -5
- package/assets/docs/guide/capabilities.md +6 -4
- package/assets/docs/guide/colors/adjust.md +247 -249
- package/assets/docs/guide/colors/apply.md +127 -138
- package/assets/docs/guide/colors/basics.md +126 -150
- package/assets/docs/guide/colors/conversion.md +171 -177
- package/assets/docs/guide/colors/create-color-palette.md +244 -245
- package/assets/docs/guide/colors/extract-colors.md +144 -0
- package/assets/docs/guide/colors/for-print/cmyk.md +292 -352
- package/assets/docs/guide/colors/for-print/spot.md +521 -578
- package/assets/docs/guide/colors/for-print.md +9 -4
- package/assets/docs/guide/colors/for-screen/p3.md +12 -10
- package/assets/docs/guide/colors/for-screen/srgb.md +107 -133
- package/assets/docs/guide/colors/for-screen.md +9 -4
- package/assets/docs/guide/colors/overview.md +6 -4
- package/assets/docs/guide/colors/replace.md +381 -419
- package/assets/docs/guide/colors.md +9 -4
- package/assets/docs/guide/compatibility.md +7 -5
- package/assets/docs/guide/concepts/architecture.md +17 -15
- package/assets/docs/guide/concepts/assets.md +152 -140
- package/assets/docs/guide/concepts/blocks.md +227 -323
- package/assets/docs/guide/concepts/buffers.md +147 -276
- package/assets/docs/guide/concepts/design-units.md +95 -145
- package/assets/docs/guide/concepts/editing-workflow.md +69 -183
- package/assets/docs/guide/concepts/events.md +80 -122
- package/assets/docs/guide/concepts/headless-mode.md +237 -0
- package/assets/docs/guide/concepts/pages.md +137 -127
- package/assets/docs/guide/concepts/resources.md +156 -217
- package/assets/docs/guide/concepts/scenes.md +191 -210
- package/assets/docs/guide/concepts/templating.md +118 -74
- package/assets/docs/guide/concepts/terminology.md +49 -47
- package/assets/docs/guide/concepts/undo-and-history.md +229 -303
- package/assets/docs/guide/concepts.md +9 -7
- package/assets/docs/guide/configuration.md +252 -380
- package/assets/docs/guide/conversion/overview.md +33 -4
- package/assets/docs/guide/conversion/to-base64.md +127 -167
- package/assets/docs/guide/conversion/to-pdf.md +24 -474
- package/assets/docs/guide/conversion/to-png.md +168 -211
- package/assets/docs/guide/conversion.md +9 -4
- package/assets/docs/guide/create-audio/audio/add-music.md +301 -327
- package/assets/docs/guide/create-audio/audio/add-sound-effects.md +475 -359
- package/assets/docs/guide/create-audio/audio/loop.md +232 -272
- package/assets/docs/guide/create-composition/add-background.md +237 -239
- package/assets/docs/guide/create-composition/blend-modes.md +118 -209
- package/assets/docs/guide/create-composition/collage.md +538 -320
- package/assets/docs/guide/create-composition/group-and-ungroup.md +216 -261
- package/assets/docs/guide/create-composition/layer-management.md +219 -257
- package/assets/docs/guide/create-composition/layout.md +513 -315
- package/assets/docs/guide/create-composition/lock-design.md +90 -109
- package/assets/docs/guide/create-composition/multi-page.md +133 -113
- package/assets/docs/guide/create-composition/overview.md +16 -4
- package/assets/docs/guide/create-composition/programmatic.md +288 -344
- package/assets/docs/guide/create-composition.md +10 -5
- package/assets/docs/guide/create-templates/add-dynamic-content/placeholders.md +443 -569
- package/assets/docs/guide/create-templates/add-dynamic-content/set-editing-constraints.md +567 -470
- package/assets/docs/guide/create-templates/add-dynamic-content/text-variables.md +179 -516
- package/assets/docs/guide/create-templates/add-dynamic-content.md +226 -224
- package/assets/docs/guide/create-templates/add-to-template-library.md +183 -193
- package/assets/docs/guide/create-templates/edit-or-remove.md +297 -303
- package/assets/docs/guide/create-templates/from-scratch.md +207 -268
- package/assets/docs/guide/create-templates/import/from-scene-file.md +158 -236
- package/assets/docs/guide/create-templates/import.md +145 -161
- package/assets/docs/guide/create-templates/lock.md +42 -295
- package/assets/docs/guide/create-templates/overview.md +33 -4
- package/assets/docs/guide/create-templates.md +9 -5
- package/assets/docs/guide/create-video/audio/adjust-speed.md +157 -207
- package/assets/docs/guide/create-video/audio/adjust-volume.md +116 -227
- package/assets/docs/guide/create-video/control.md +352 -193
- package/assets/docs/guide/create-video/limitations.md +175 -280
- package/assets/docs/guide/create-video.md +11 -10
- package/assets/docs/guide/edit-image/add-watermark.md +283 -330
- package/assets/docs/guide/edit-image/overview.md +29 -4
- package/assets/docs/guide/edit-image/remove-bg.md +283 -337
- package/assets/docs/guide/edit-image/replace-colors.md +424 -502
- package/assets/docs/guide/edit-image/transform/crop.md +463 -402
- package/assets/docs/guide/edit-image/transform/flip.md +353 -0
- package/assets/docs/guide/edit-image/transform/move.md +143 -100
- package/assets/docs/guide/edit-image/transform/resize.md +118 -88
- package/assets/docs/guide/edit-image/transform/rotate.md +132 -165
- package/assets/docs/guide/edit-image/transform/scale.md +230 -228
- package/assets/docs/guide/edit-image/transform.md +10 -5
- package/assets/docs/guide/edit-image.md +11 -7
- package/assets/docs/guide/edit-video/add-captions.md +344 -421
- package/assets/docs/guide/edit-video/add-watermark.md +312 -258
- package/assets/docs/guide/edit-video/join-and-arrange.md +237 -371
- package/assets/docs/guide/edit-video/redaction.md +419 -385
- package/assets/docs/guide/edit-video/split.md +243 -493
- package/assets/docs/guide/edit-video/transform/crop.md +21 -352
- package/assets/docs/guide/edit-video/transform/flip.md +102 -76
- package/assets/docs/guide/edit-video/transform/move.md +258 -310
- package/assets/docs/guide/edit-video/transform/resize.md +264 -428
- package/assets/docs/guide/edit-video/transform/rotate.md +265 -228
- package/assets/docs/guide/edit-video/transform/scale.md +320 -417
- package/assets/docs/guide/edit-video/transform.md +10 -6
- package/assets/docs/guide/edit-video/trim.md +448 -494
- package/assets/docs/guide/engine-interface.md +51 -62
- package/assets/docs/guide/export-save-publish/create-thumbnail.md +148 -184
- package/assets/docs/guide/export-save-publish/export/compress.md +161 -559
- package/assets/docs/guide/export-save-publish/export/overview.md +224 -373
- package/assets/docs/guide/export-save-publish/export/partial-export.md +386 -577
- package/assets/docs/guide/export-save-publish/export/size-limits.md +215 -310
- package/assets/docs/guide/export-save-publish/export/to-jpeg.md +132 -213
- package/assets/docs/guide/export-save-publish/export/to-pdf.md +139 -267
- package/assets/docs/guide/export-save-publish/export/to-png.md +121 -165
- package/assets/docs/guide/export-save-publish/export/to-raw-data.md +187 -234
- package/assets/docs/guide/export-save-publish/export/to-webp.md +160 -190
- package/assets/docs/guide/export-save-publish/export/with-color-mask.md +359 -203
- package/assets/docs/guide/export-save-publish/export.md +14 -11
- package/assets/docs/guide/export-save-publish/for-printing.md +141 -237
- package/assets/docs/guide/export-save-publish/for-social-media.md +124 -261
- package/assets/docs/guide/export-save-publish/pre-export-validation.md +436 -522
- package/assets/docs/guide/export-save-publish/save.md +167 -226
- package/assets/docs/guide/export-save-publish/store-custom-metadata.md +97 -162
- package/assets/docs/guide/file-format-support.md +9 -9
- package/assets/docs/guide/fills/color.md +370 -347
- package/assets/docs/guide/fills/image.md +167 -196
- package/assets/docs/guide/fills/overview.md +6 -4
- package/assets/docs/guide/fills/video.md +286 -438
- package/assets/docs/guide/fills.md +12 -8
- package/assets/docs/guide/filters-and-effects/apply.md +598 -664
- package/assets/docs/guide/filters-and-effects/blur.md +261 -159
- package/assets/docs/guide/filters-and-effects/chroma-key-green-screen.md +194 -293
- package/assets/docs/guide/filters-and-effects/create-custom-filters.md +548 -466
- package/assets/docs/guide/filters-and-effects/create-custom-lut-filter.md +176 -244
- package/assets/docs/guide/filters-and-effects/distortion.md +317 -384
- package/assets/docs/guide/filters-and-effects/duotone.md +221 -217
- package/assets/docs/guide/filters-and-effects/gradients.md +670 -813
- package/assets/docs/guide/filters-and-effects/overview.md +7 -7
- package/assets/docs/guide/filters-and-effects/support.md +97 -132
- package/assets/docs/guide/filters-and-effects.md +11 -6
- package/assets/docs/guide/get-started/agent-skills.md +20 -18
- package/assets/docs/guide/get-started/build-with-ai.md +7 -4
- package/assets/docs/guide/get-started/bun.md +219 -0
- package/assets/docs/guide/get-started/deno.md +161 -0
- package/assets/docs/guide/get-started/mcp-server.md +6 -4
- package/assets/docs/guide/get-started/overview.md +11 -6
- package/assets/docs/guide/get-started/vanilla-aws-lambda.md +506 -0
- package/assets/docs/guide/get-started/vanilla-clone-github-project.md +124 -0
- package/assets/docs/guide/get-started/vanilla.md +235 -0
- package/assets/docs/guide/guides/export-save-publish/export/audio.md +80 -66
- package/assets/docs/guide/guides.md +10 -9
- package/assets/docs/guide/import-media/asset-panel/refresh-assets.md +259 -288
- package/assets/docs/guide/import-media/concepts.md +20 -38
- package/assets/docs/guide/import-media/content-json-schema.md +145 -125
- package/assets/docs/guide/import-media/default-assets.md +113 -161
- package/assets/docs/guide/import-media/edit-or-remove-assets.md +391 -395
- package/assets/docs/guide/import-media/file-format-support.md +78 -61
- package/assets/docs/guide/import-media/from-remote-source/asset-versioning.md +273 -244
- package/assets/docs/guide/import-media/from-remote-source/remote-asset.md +152 -222
- package/assets/docs/guide/import-media/from-remote-source.md +9 -11
- package/assets/docs/guide/import-media/overview.md +5 -5
- package/assets/docs/guide/import-media/retrieve-mimetype.md +216 -108
- package/assets/docs/guide/import-media/size-limits.md +6 -4
- package/assets/docs/guide/import-media/source-sets.md +190 -251
- package/assets/docs/guide/import-media.md +10 -8
- package/assets/docs/guide/insert-media/audio.md +202 -195
- package/assets/docs/guide/insert-media/images.md +190 -188
- package/assets/docs/guide/insert-media/position-and-align.md +284 -551
- package/assets/docs/guide/insert-media/shapes-or-stickers.md +402 -418
- package/assets/docs/guide/insert-media/videos.md +236 -203
- package/assets/docs/guide/insert-media.md +10 -5
- package/assets/docs/guide/key-capabilities.md +36 -4
- package/assets/docs/guide/key-concepts.md +6 -4
- package/assets/docs/guide/licensing.md +6 -4
- package/assets/docs/guide/llms-txt.md +11 -7
- package/assets/docs/guide/open-the-editor/blank-canvas.md +102 -63
- package/assets/docs/guide/open-the-editor/from-image.md +157 -127
- package/assets/docs/guide/open-the-editor/from-template.md +131 -92
- package/assets/docs/guide/open-the-editor/from-video.md +204 -212
- package/assets/docs/guide/open-the-editor/import-design/from-archive.md +310 -360
- package/assets/docs/guide/open-the-editor/import-design/from-indesign.md +716 -513
- package/assets/docs/guide/open-the-editor/import-design/from-photoshop.md +667 -695
- package/assets/docs/guide/open-the-editor/import-design.md +228 -266
- package/assets/docs/guide/open-the-editor/load-scene.md +72 -68
- package/assets/docs/guide/open-the-editor/overview.md +6 -4
- package/assets/docs/guide/open-the-editor/uri-resolver.md +160 -251
- package/assets/docs/guide/open-the-editor.md +11 -9
- package/assets/docs/guide/outlines/overview.md +12 -4
- package/assets/docs/guide/outlines/shadows-and-glows.md +105 -410
- package/assets/docs/guide/outlines/strokes.md +218 -166
- package/assets/docs/guide/outlines.md +9 -4
- package/assets/docs/guide/overview.md +14 -6
- package/assets/docs/guide/performance.md +220 -113
- package/assets/docs/guide/plugins/print-ready-pdf.md +273 -368
- package/assets/docs/guide/plugins.md +10 -16
- package/assets/docs/guide/rules/asset-handling.md +7 -18
- package/assets/docs/guide/rules/common-pitfalls.md +25 -42
- package/assets/docs/guide/rules/content-fill-mode.md +4 -4
- package/assets/docs/guide/rules/enforce-brand-guidelines.md +398 -567
- package/assets/docs/guide/rules/lock-content.md +188 -231
- package/assets/docs/guide/rules/moderate-content.md +580 -571
- package/assets/docs/guide/rules/overview.md +345 -380
- package/assets/docs/guide/rules/silent-init-errors.md +4 -1
- package/assets/docs/guide/rules/verify-properties-before-use.md +2 -11
- package/assets/docs/guide/rules.md +10 -5
- package/assets/docs/guide/security.md +7 -5
- package/assets/docs/guide/serve-assets.md +57 -284
- package/assets/docs/guide/settings.md +96 -74
- package/assets/docs/guide/shapes.md +10 -5
- package/assets/docs/guide/stickers-and-shapes/combine.md +397 -583
- package/assets/docs/guide/stickers-and-shapes/create-cutout.md +181 -268
- package/assets/docs/guide/stickers-and-shapes/create-edit/create-shapes.md +418 -431
- package/assets/docs/guide/stickers-and-shapes/create-edit/create-stickers.md +147 -226
- package/assets/docs/guide/stickers-and-shapes/create-edit/edit-shapes.md +138 -123
- package/assets/docs/guide/stickers-and-shapes/insert-qr-code.md +151 -149
- package/assets/docs/guide/stickers.md +9 -4
- package/assets/docs/guide/text/add.md +470 -482
- package/assets/docs/guide/text/adjust-spacing.md +179 -214
- package/assets/docs/guide/text/auto-size.md +210 -271
- package/assets/docs/guide/text/edit.md +294 -309
- package/assets/docs/guide/text/effects.md +154 -190
- package/assets/docs/guide/text/emojis.md +199 -232
- package/assets/docs/guide/text/language-support.md +369 -382
- package/assets/docs/guide/text/overview.md +41 -4
- package/assets/docs/guide/text/styling.md +239 -273
- package/assets/docs/guide/text/text-designs.md +405 -544
- package/assets/docs/guide/text.md +10 -9
- package/assets/docs/guide/to-v1-19.md +12 -10
- package/assets/docs/guide/upgrade.md +8 -9
- package/assets/docs/guide/use-templates/apply-template.md +174 -163
- package/assets/docs/guide/use-templates/generate.md +171 -152
- package/assets/docs/guide/use-templates/overview.md +32 -4
- package/assets/docs/guide/use-templates/programmatic.md +266 -301
- package/assets/docs/guide/use-templates/replace-content.md +181 -171
- package/assets/docs/guide/what-is-cesdk.md +71 -282
- package/assets/docs/handbook/SKILL.md +24 -0
- package/dist/assets/inline.generated.d.ts.map +1 -1
- package/dist/assets/inline.generated.js +544 -406
- package/dist/assets/inline.generated.js.map +1 -1
- package/dist/assets/load-browser.d.ts +1 -1
- package/dist/assets/load-browser.js +1 -1
- package/dist/assets/load-browser.js.map +1 -1
- package/dist/assets/load-node.d.ts +1 -1
- package/dist/assets/load-node.js +1 -1
- package/dist/assets/load-node.js.map +1 -1
- package/dist/cli/http.d.ts.map +1 -1
- package/dist/cli/http.js +4 -28
- package/dist/cli/http.js.map +1 -1
- package/dist/cli/redirect-console.d.ts +1 -1
- package/dist/cli/redirect-console.d.ts.map +1 -1
- package/dist/cli/redirect-console.js +12 -3
- package/dist/cli/redirect-console.js.map +1 -1
- package/dist/cli/resolve-license.d.ts.map +1 -1
- package/dist/cli/resolve-license.js +8 -6
- package/dist/cli/resolve-license.js.map +1 -1
- package/dist/cli/stdio.d.ts +9 -0
- package/dist/cli/stdio.d.ts.map +1 -1
- package/dist/cli/stdio.js +48 -4
- package/dist/cli/stdio.js.map +1 -1
- package/dist/cli.js +10 -1
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +11 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +20 -1
- package/dist/config.js.map +1 -1
- package/dist/diagnostics/bundle.d.ts +10 -0
- package/dist/diagnostics/bundle.d.ts.map +1 -0
- package/dist/diagnostics/bundle.js +148 -0
- package/dist/diagnostics/bundle.js.map +1 -0
- package/dist/diagnostics/compose.d.ts +3 -0
- package/dist/diagnostics/compose.d.ts.map +1 -0
- package/dist/diagnostics/compose.js +15 -0
- package/dist/diagnostics/compose.js.map +1 -0
- package/dist/diagnostics/events.d.ts +34 -0
- package/dist/diagnostics/events.d.ts.map +1 -0
- package/dist/diagnostics/events.js +3 -0
- package/dist/diagnostics/events.js.map +1 -0
- package/dist/diagnostics/file-sink.d.ts +38 -0
- package/dist/diagnostics/file-sink.d.ts.map +1 -0
- package/dist/diagnostics/file-sink.js +157 -0
- package/dist/diagnostics/file-sink.js.map +1 -0
- package/dist/diagnostics/redact.d.ts +7 -0
- package/dist/diagnostics/redact.d.ts.map +1 -0
- package/dist/diagnostics/redact.js +43 -0
- package/dist/diagnostics/redact.js.map +1 -0
- package/dist/diagnostics/tool-call-adapter.d.ts +4 -0
- package/dist/diagnostics/tool-call-adapter.d.ts.map +1 -0
- package/dist/diagnostics/tool-call-adapter.js +21 -0
- package/dist/diagnostics/tool-call-adapter.js.map +1 -0
- package/dist/engine/cesdk-adapter.d.ts +5 -1
- package/dist/engine/cesdk-adapter.d.ts.map +1 -1
- package/dist/engine/cesdk-adapter.js +9 -2
- package/dist/engine/cesdk-adapter.js.map +1 -1
- package/dist/engine/index.d.ts +1 -0
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +4 -0
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/scene-resource-schemes.d.ts +2 -0
- package/dist/engine/scene-resource-schemes.d.ts.map +1 -0
- package/dist/engine/scene-resource-schemes.js +20 -0
- package/dist/engine/scene-resource-schemes.js.map +1 -0
- package/dist/http/server.d.ts +0 -6
- package/dist/http/server.d.ts.map +1 -1
- package/dist/http/server.js +1 -2
- package/dist/http/server.js.map +1 -1
- package/dist/server.d.ts +0 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -60
- package/dist/server.js.map +1 -1
- package/dist/test/scripts/changelog-add.d.ts +8 -0
- package/dist/test/scripts/changelog-add.d.ts.map +1 -0
- package/dist/test/scripts/changelog-add.js +50 -0
- package/dist/test/scripts/changelog-add.js.map +1 -0
- package/dist/test/scripts/changelog-collate.d.ts +38 -0
- package/dist/test/scripts/changelog-collate.d.ts.map +1 -0
- package/dist/test/scripts/changelog-collate.js +171 -0
- package/dist/test/scripts/changelog-collate.js.map +1 -0
- package/dist/test/test/changelog.test.d.ts +2 -0
- package/dist/test/test/changelog.test.d.ts.map +1 -0
- package/dist/test/test/changelog.test.js +293 -0
- package/dist/test/test/changelog.test.js.map +1 -0
- package/dist/test/test/cli/dispatcher.test.js +10 -3
- package/dist/test/test/cli/dispatcher.test.js.map +1 -1
- package/dist/test/test/cli/redirect-console.test.js +31 -0
- package/dist/test/test/cli/redirect-console.test.js.map +1 -1
- package/dist/test/test/cli/resolve-license.test.js +10 -1
- package/dist/test/test/cli/resolve-license.test.js.map +1 -1
- package/dist/test/test/cli/stdio-diagnostics.test.d.ts +2 -0
- package/dist/test/test/cli/stdio-diagnostics.test.d.ts.map +1 -0
- package/dist/test/test/cli/stdio-diagnostics.test.js +31 -0
- package/dist/test/test/cli/stdio-diagnostics.test.js.map +1 -0
- package/dist/test/test/config.test.js +17 -13
- package/dist/test/test/config.test.js.map +1 -1
- package/dist/test/test/diagnostics/bundle.test.d.ts +2 -0
- package/dist/test/test/diagnostics/bundle.test.d.ts.map +1 -0
- package/dist/test/test/diagnostics/bundle.test.js +53 -0
- package/dist/test/test/diagnostics/bundle.test.js.map +1 -0
- package/dist/test/test/diagnostics/compose.test.d.ts +2 -0
- package/dist/test/test/diagnostics/compose.test.d.ts.map +1 -0
- package/dist/test/test/diagnostics/compose.test.js +31 -0
- package/dist/test/test/diagnostics/compose.test.js.map +1 -0
- package/dist/test/test/diagnostics/file-sink.test.d.ts +2 -0
- package/dist/test/test/diagnostics/file-sink.test.d.ts.map +1 -0
- package/dist/test/test/diagnostics/file-sink.test.js +113 -0
- package/dist/test/test/diagnostics/file-sink.test.js.map +1 -0
- package/dist/test/test/diagnostics/redact.test.d.ts +2 -0
- package/dist/test/test/diagnostics/redact.test.d.ts.map +1 -0
- package/dist/test/test/diagnostics/redact.test.js +59 -0
- package/dist/test/test/diagnostics/redact.test.js.map +1 -0
- package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts +2 -0
- package/dist/test/test/diagnostics/tool-call-adapter.test.d.ts.map +1 -0
- package/dist/test/test/diagnostics/tool-call-adapter.test.js +34 -0
- package/dist/test/test/diagnostics/tool-call-adapter.test.js.map +1 -0
- package/dist/test/test/engine/cesdk-adapter.test.d.ts +2 -0
- package/dist/test/test/engine/cesdk-adapter.test.d.ts.map +1 -0
- package/dist/test/test/engine/cesdk-adapter.test.js +32 -0
- package/dist/test/test/engine/cesdk-adapter.test.js.map +1 -0
- package/dist/test/test/handbook-contract.test.js +6 -2
- package/dist/test/test/handbook-contract.test.js.map +1 -1
- package/dist/test/test/http/server.test.js +0 -36
- package/dist/test/test/http/server.test.js.map +1 -1
- package/dist/test/test/http/workspace-auth.test.js +0 -1
- package/dist/test/test/http/workspace-auth.test.js.map +1 -1
- package/dist/test/test/server.test.js +0 -40
- package/dist/test/test/server.test.js.map +1 -1
- package/dist/test/test/tools/edit-harness.d.ts +14 -0
- package/dist/test/test/tools/edit-harness.d.ts.map +1 -0
- package/dist/test/test/tools/edit-harness.js +30 -0
- package/dist/test/test/tools/edit-harness.js.map +1 -0
- package/dist/test/test/tools/edit.telemetry.test.d.ts +2 -0
- package/dist/test/test/tools/edit.telemetry.test.d.ts.map +1 -0
- package/dist/test/test/tools/edit.telemetry.test.js +46 -0
- package/dist/test/test/tools/edit.telemetry.test.js.map +1 -0
- package/dist/test/test/tools/export-harness.d.ts +13 -0
- package/dist/test/test/tools/export-harness.d.ts.map +1 -0
- package/dist/test/test/tools/export-harness.js +27 -0
- package/dist/test/test/tools/export-harness.js.map +1 -0
- package/dist/test/test/tools/export.telemetry.test.d.ts +2 -0
- package/dist/test/test/tools/export.telemetry.test.d.ts.map +1 -0
- package/dist/test/test/tools/export.telemetry.test.js +65 -0
- package/dist/test/test/tools/export.telemetry.test.js.map +1 -0
- package/dist/test/test/tools/import.test.d.ts +2 -0
- package/dist/test/test/tools/import.test.d.ts.map +1 -0
- package/dist/test/test/tools/import.test.js +122 -0
- package/dist/test/test/tools/import.test.js.map +1 -0
- package/dist/test/test/tools/index.test.js +78 -16
- package/dist/test/test/tools/index.test.js.map +1 -1
- package/dist/test/test/tools/load.integration.test.d.ts +2 -0
- package/dist/test/test/tools/load.integration.test.d.ts.map +1 -0
- package/dist/test/test/tools/load.integration.test.js +165 -0
- package/dist/test/test/tools/load.integration.test.js.map +1 -0
- package/dist/test/test/tools/load.test.d.ts +2 -0
- package/dist/test/test/tools/load.test.d.ts.map +1 -0
- package/dist/test/test/tools/load.test.js +387 -0
- package/dist/test/test/tools/load.test.js.map +1 -0
- package/dist/test/test/tools/preview-harness.d.ts +9 -0
- package/dist/test/test/tools/preview-harness.d.ts.map +1 -0
- package/dist/test/test/tools/preview-harness.js +23 -0
- package/dist/test/test/tools/preview-harness.js.map +1 -0
- package/dist/test/test/tools/preview.telemetry.test.d.ts +2 -0
- package/dist/test/test/tools/preview.telemetry.test.d.ts.map +1 -0
- package/dist/test/test/tools/preview.telemetry.test.js +36 -0
- package/dist/test/test/tools/preview.telemetry.test.js.map +1 -0
- package/dist/test/test/tools/schema-best-practices.d.ts +13 -0
- package/dist/test/test/tools/schema-best-practices.d.ts.map +1 -0
- package/dist/test/test/tools/schema-best-practices.js +169 -0
- package/dist/test/test/tools/schema-best-practices.js.map +1 -0
- package/dist/test/test/tools/schema-best-practices.test.d.ts +3 -0
- package/dist/test/test/tools/schema-best-practices.test.d.ts.map +1 -0
- package/dist/test/test/tools/schema-best-practices.test.js +194 -0
- package/dist/test/test/tools/schema-best-practices.test.js.map +1 -0
- package/dist/test/test/tools/spans.test.d.ts +2 -0
- package/dist/test/test/tools/spans.test.d.ts.map +1 -0
- package/dist/test/test/tools/spans.test.js +84 -0
- package/dist/test/test/tools/spans.test.js.map +1 -0
- package/dist/test/test/viewer/cesdk-cdn.test.d.ts +2 -0
- package/dist/test/test/viewer/cesdk-cdn.test.d.ts.map +1 -0
- package/dist/test/test/viewer/cesdk-cdn.test.js +19 -0
- package/dist/test/test/viewer/cesdk-cdn.test.js.map +1 -0
- package/dist/test/test/viewer/config-route.test.d.ts +2 -0
- package/dist/test/test/viewer/config-route.test.d.ts.map +1 -0
- package/dist/test/test/viewer/config-route.test.js +28 -0
- package/dist/test/test/viewer/config-route.test.js.map +1 -0
- package/dist/test/test/viewer/spa-version.test.d.ts +2 -0
- package/dist/test/test/viewer/spa-version.test.d.ts.map +1 -0
- package/dist/test/test/viewer/spa-version.test.js +14 -0
- package/dist/test/test/viewer/spa-version.test.js.map +1 -0
- package/dist/test/test/workspace/content-hash.test.d.ts +2 -0
- package/dist/test/test/workspace/content-hash.test.d.ts.map +1 -0
- package/dist/test/test/workspace/content-hash.test.js +17 -0
- package/dist/test/test/workspace/content-hash.test.js.map +1 -0
- package/dist/test/tsconfig.test.tsbuildinfo +1 -1
- package/dist/test/vitest.config.js +1 -1
- package/dist/test/vitest.config.js.map +1 -1
- package/dist/tools/asset-generate.d.ts.map +1 -1
- package/dist/tools/asset-generate.js +1 -8
- package/dist/tools/asset-generate.js.map +1 -1
- package/dist/tools/edit.d.ts +3 -0
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +145 -96
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/export.d.ts +3 -0
- package/dist/tools/export.d.ts.map +1 -1
- package/dist/tools/export.js +146 -108
- package/dist/tools/export.js.map +1 -1
- package/dist/tools/import.d.ts +12 -0
- package/dist/tools/import.d.ts.map +1 -0
- package/dist/tools/import.js +144 -0
- package/dist/tools/import.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +44 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/load.d.ts +26 -0
- package/dist/tools/load.d.ts.map +1 -0
- package/dist/tools/load.js +400 -0
- package/dist/tools/load.js.map +1 -0
- package/dist/tools/preview.d.ts +3 -0
- package/dist/tools/preview.d.ts.map +1 -1
- package/dist/tools/preview.js +79 -44
- package/dist/tools/preview.js.map +1 -1
- package/dist/tools/result.d.ts +1 -1
- package/dist/tools/result.js +2 -2
- package/dist/tools/result.js.map +1 -1
- package/dist/tools/spans.d.ts +45 -0
- package/dist/tools/spans.d.ts.map +1 -0
- package/dist/tools/spans.js +77 -0
- package/dist/tools/spans.js.map +1 -0
- package/dist/tools/telemetry-wrapper.d.ts +4 -0
- package/dist/tools/telemetry-wrapper.d.ts.map +1 -0
- package/dist/tools/telemetry-wrapper.js +43 -0
- package/dist/tools/telemetry-wrapper.js.map +1 -0
- package/dist/viewer/cesdk-cdn.d.ts +16 -0
- package/dist/viewer/cesdk-cdn.d.ts.map +1 -0
- package/dist/viewer/cesdk-cdn.js +30 -0
- package/dist/viewer/cesdk-cdn.js.map +1 -0
- package/dist/viewer/router.d.ts +6 -0
- package/dist/viewer/router.d.ts.map +1 -1
- package/dist/viewer/router.js +4 -1
- package/dist/viewer/router.js.map +1 -1
- package/dist/viewer/spa-assets.generated.d.ts.map +1 -1
- package/dist/viewer/spa-assets.generated.js +2 -3
- package/dist/viewer/spa-assets.generated.js.map +1 -1
- package/dist/workspace/content-hash.d.ts +2 -0
- package/dist/workspace/content-hash.d.ts.map +1 -0
- package/dist/workspace/content-hash.js +15 -0
- package/dist/workspace/content-hash.js.map +1 -0
- package/package.json +18 -9
- package/assets/docs/guide/actions.md +0 -1038
- package/assets/docs/guide/animation/overview.md +0 -22
- package/assets/docs/guide/automation/batch-processing.md +0 -474
- package/assets/docs/guide/browser-support.md +0 -38
- package/assets/docs/guide/concepts/edit-modes.md +0 -431
- package/assets/docs/guide/concepts/headless-mode/browser.md +0 -291
- package/assets/docs/guide/create-audio/audio.md +0 -336
- package/assets/docs/guide/create-video/overview.md +0 -224
- package/assets/docs/guide/create-video/timeline-editor.md +0 -622
- package/assets/docs/guide/create-video/update-caption-presets.md +0 -676
- package/assets/docs/guide/edit-image/vectorize.md +0 -204
- package/assets/docs/guide/export-save-publish/export/to-html5.md +0 -474
- package/assets/docs/guide/export-save-publish/export/to-mp4.md +0 -364
- package/assets/docs/guide/get-started/vanilla-js/quickstart.md +0 -175
- package/assets/docs/guide/grid-and-rulers.md +0 -222
- package/assets/docs/guide/guides/text/rendering-internals.md +0 -796
- package/assets/docs/guide/import-media/asset-library.md +0 -23
- package/assets/docs/guide/import-media/asset-panel/basics.md +0 -324
- package/assets/docs/guide/import-media/asset-panel/customize.md +0 -478
- package/assets/docs/guide/import-media/asset-panel/thumbnails.md +0 -633
- package/assets/docs/guide/import-media/capture-from-camera/record-video.md +0 -137
- package/assets/docs/guide/import-media/capture-from-camera.md +0 -20
- package/assets/docs/guide/import-media/from-local-source/user-upload.md +0 -438
- package/assets/docs/guide/import-media/from-local-source.md +0 -20
- package/assets/docs/guide/import-media/from-remote-source/getty-images.md +0 -627
- package/assets/docs/guide/import-media/from-remote-source/imgly-premium-assets.md +0 -625
- package/assets/docs/guide/import-media/from-remote-source/pexels.md +0 -692
- package/assets/docs/guide/import-media/from-remote-source/soundstripe.md +0 -497
- package/assets/docs/guide/import-media/from-remote-source/third-party.md +0 -51
- package/assets/docs/guide/import-media/from-remote-source/unsplash.md +0 -914
- package/assets/docs/guide/import-media/from-remote-source/your-server.md +0 -764
- package/assets/docs/guide/open-the-editor/from-htmlcanvas.md +0 -228
- package/assets/docs/guide/open-the-editor/set-zoom-level.md +0 -303
- package/assets/docs/guide/plugins/asset-sources.md +0 -553
- package/assets/docs/guide/starterkits/3d-mockup-editor.md +0 -748
- package/assets/docs/guide/starterkits/advanced-editor.md +0 -698
- package/assets/docs/guide/starterkits/advanced-video-editor.md +0 -696
- package/assets/docs/guide/starterkits/ai-editor.md +0 -749
- package/assets/docs/guide/starterkits/airtable-image-editor.md +0 -672
- package/assets/docs/guide/starterkits/apparel-ui.md +0 -188
- package/assets/docs/guide/starterkits/assets.md +0 -27
- package/assets/docs/guide/starterkits/auto-resize.md +0 -586
- package/assets/docs/guide/starterkits/automated-video-generation.md +0 -692
- package/assets/docs/guide/starterkits/background-removal-editor.md +0 -480
- package/assets/docs/guide/starterkits/content-moderation.md +0 -863
- package/assets/docs/guide/starterkits/creative-automation.md +0 -28
- package/assets/docs/guide/starterkits/custom-built-uis.md +0 -26
- package/assets/docs/guide/starterkits/customization.md +0 -29
- package/assets/docs/guide/starterkits/cutout-lines-editor.md +0 -470
- package/assets/docs/guide/starterkits/data-merge.md +0 -850
- package/assets/docs/guide/starterkits/design-editor.md +0 -698
- package/assets/docs/guide/starterkits/design-generation.md +0 -719
- package/assets/docs/guide/starterkits/design-validation.md +0 -808
- package/assets/docs/guide/starterkits/editor-ui-configurations.md +0 -14
- package/assets/docs/guide/starterkits/export-options.md +0 -724
- package/assets/docs/guide/starterkits/export-using-renderer.md +0 -708
- package/assets/docs/guide/starterkits/extensibility.md +0 -28
- package/assets/docs/guide/starterkits/force-crop-editor.md +0 -675
- package/assets/docs/guide/starterkits/form-based-template-adoption.md +0 -522
- package/assets/docs/guide/starterkits/getty-images-editor.md +0 -700
- package/assets/docs/guide/starterkits/html5-ads-exporter.md +0 -719
- package/assets/docs/guide/starterkits/indesign-template-import.md +0 -580
- package/assets/docs/guide/starterkits/layouts-editor.md +0 -724
- package/assets/docs/guide/starterkits/mobile-ui.md +0 -185
- package/assets/docs/guide/starterkits/mockup-editor.md +0 -745
- package/assets/docs/guide/starterkits/multi-image-generation.md +0 -542
- package/assets/docs/guide/starterkits/page-sizes-editor.md +0 -657
- package/assets/docs/guide/starterkits/pexels-image-editor.md +0 -665
- package/assets/docs/guide/starterkits/photo-editor.md +0 -755
- package/assets/docs/guide/starterkits/photo-ui.md +0 -186
- package/assets/docs/guide/starterkits/photobook-ui.md +0 -188
- package/assets/docs/guide/starterkits/placeholders.md +0 -678
- package/assets/docs/guide/starterkits/player.md +0 -405
- package/assets/docs/guide/starterkits/plugins.md +0 -25
- package/assets/docs/guide/starterkits/postcard-editor.md +0 -202
- package/assets/docs/guide/starterkits/pptx-template-import.md +0 -581
- package/assets/docs/guide/starterkits/print-ready-pdf-editor.md +0 -746
- package/assets/docs/guide/starterkits/product-editor.md +0 -773
- package/assets/docs/guide/starterkits/psd-template-import.md +0 -580
- package/assets/docs/guide/starterkits/qr-code-editor.md +0 -470
- package/assets/docs/guide/starterkits/single-page-editor.md +0 -661
- package/assets/docs/guide/starterkits/start-with-image.md +0 -684
- package/assets/docs/guide/starterkits/start-with-video.md +0 -651
- package/assets/docs/guide/starterkits/t-shirt-designer.md +0 -742
- package/assets/docs/guide/starterkits/templating.md +0 -23
- package/assets/docs/guide/starterkits/theming.md +0 -662
- package/assets/docs/guide/starterkits/translation-internationalization.md +0 -662
- package/assets/docs/guide/starterkits/unsplash-editor.md +0 -839
- package/assets/docs/guide/starterkits/vectorizer-editor.md +0 -466
- package/assets/docs/guide/starterkits/version-history.md +0 -745
- package/assets/docs/guide/starterkits/video-animations.md +0 -853
- package/assets/docs/guide/starterkits/video-captions.md +0 -884
- package/assets/docs/guide/starterkits/video-editing.md +0 -25
- package/assets/docs/guide/starterkits/video-editor.md +0 -696
- package/assets/docs/guide/starterkits/video-export-options.md +0 -676
- package/assets/docs/guide/starterkits/viewer.md +0 -400
- package/assets/docs/guide/starterkits.md +0 -41
- package/assets/docs/guide/stickers-and-shapes/create-edit/vector-edit.md +0 -362
- package/assets/docs/guide/text/custom-fonts.md +0 -401
- package/assets/docs/guide/text/decorations.md +0 -330
- package/assets/docs/guide/text/enumerations.md +0 -258
- package/assets/docs/guide/to-v1-10.md +0 -131
- package/assets/docs/guide/to-v1-13.md +0 -165
- package/assets/docs/guide/to-v1-32.md +0 -110
- package/assets/docs/guide/to-v1-69.md +0 -468
- package/assets/docs/guide/to-v1-72.md +0 -193
- package/assets/docs/guide/use-templates/library.md +0 -450
- package/assets/docs/guide/user-interface/ai-integration/audio-generation.md +0 -428
- package/assets/docs/guide/user-interface/ai-integration/auto-captions.md +0 -337
- package/assets/docs/guide/user-interface/ai-integration/custom-provider.md +0 -853
- package/assets/docs/guide/user-interface/ai-integration/gateway-provider.md +0 -1045
- package/assets/docs/guide/user-interface/ai-integration/image-generation.md +0 -641
- package/assets/docs/guide/user-interface/ai-integration/integrate.md +0 -966
- package/assets/docs/guide/user-interface/ai-integration/proxy-server.md +0 -99
- package/assets/docs/guide/user-interface/ai-integration/text-generation.md +0 -498
- package/assets/docs/guide/user-interface/ai-integration/video-generation.md +0 -493
- package/assets/docs/guide/user-interface/ai-integration.md +0 -30
- package/assets/docs/guide/user-interface/appearance/change-ui-font.md +0 -316
- package/assets/docs/guide/user-interface/appearance/custom-labels.md +0 -509
- package/assets/docs/guide/user-interface/appearance/icons.md +0 -373
- package/assets/docs/guide/user-interface/appearance/theming.md +0 -665
- package/assets/docs/guide/user-interface/appearance.md +0 -23
- package/assets/docs/guide/user-interface/build-your-own-ui.md +0 -620
- package/assets/docs/guide/user-interface/customization/canvas-menu.md +0 -412
- package/assets/docs/guide/user-interface/customization/canvas.md +0 -281
- package/assets/docs/guide/user-interface/customization/color-palette.md +0 -413
- package/assets/docs/guide/user-interface/customization/crop-presets.md +0 -384
- package/assets/docs/guide/user-interface/customization/disable-or-enable.md +0 -676
- package/assets/docs/guide/user-interface/customization/dock.md +0 -399
- package/assets/docs/guide/user-interface/customization/force-crop.md +0 -289
- package/assets/docs/guide/user-interface/customization/inspector-bar.md +0 -371
- package/assets/docs/guide/user-interface/customization/navigation-bar.md +0 -516
- package/assets/docs/guide/user-interface/customization/page-format.md +0 -436
- package/assets/docs/guide/user-interface/customization/panel.md +0 -605
- package/assets/docs/guide/user-interface/customization/quick-start/add-action-buttons.md +0 -531
- package/assets/docs/guide/user-interface/customization/quick-start/add-dock-buttons.md +0 -358
- package/assets/docs/guide/user-interface/customization/quick-start/create-custom-components.md +0 -374
- package/assets/docs/guide/user-interface/customization/quick-start/reorder-components.md +0 -323
- package/assets/docs/guide/user-interface/customization/quick-start/show-hide-components.md +0 -294
- package/assets/docs/guide/user-interface/customization/quick-start.md +0 -12
- package/assets/docs/guide/user-interface/customization/reference/component-order-api.md +0 -519
- package/assets/docs/guide/user-interface/customization/reference/component-reference.md +0 -333
- package/assets/docs/guide/user-interface/customization/reference.md +0 -12
- package/assets/docs/guide/user-interface/customization.md +0 -39
- package/assets/docs/guide/user-interface/localization.md +0 -633
- package/assets/docs/guide/user-interface/overview.md +0 -167
- package/assets/docs/guide/user-interface/ui-extensions/add-custom-feature.md +0 -411
- package/assets/docs/guide/user-interface/ui-extensions/asset-library.md +0 -721
- package/assets/docs/guide/user-interface/ui-extensions/create-custom-panel.md +0 -331
- package/assets/docs/guide/user-interface/ui-extensions/customize-behaviour.md +0 -553
- package/assets/docs/guide/user-interface/ui-extensions/notifications-and-dialogs.md +0 -672
- package/assets/docs/guide/user-interface/ui-extensions/quick-actions.md +0 -415
- package/assets/docs/guide/user-interface/ui-extensions/register-new-component.md +0 -521
- package/assets/docs/guide/user-interface/ui-extensions.md +0 -26
- package/assets/docs/guide/user-interface.md +0 -25
- package/assets/prompts/evals-assetGenerate.md +0 -12
- package/assets/prompts/evals-brutalistCore.md +0 -34
- package/assets/prompts/evals-danskCatalogue.md +0 -31
- package/assets/prompts/evals-exportRoundTrip.md +0 -12
- package/assets/prompts/evals-inspectPriorCode.md +0 -16
- package/assets/prompts/evals-listProjectFiles.md +0 -6
- package/assets/prompts/evals-readAndExplainScript.md +0 -6
- package/assets/prompts/evals-resumeAcrossRestart.md +0 -15
- package/assets/prompts/evals-rewindRecovery.md +0 -10
- package/assets/prompts/evals-searchAcrossFiles.md +0 -6
- package/assets/prompts/evals-weddingCard.md +0 -20
- package/assets/prompts/explain.md +0 -6
- package/assets/prompts/review.md +0 -6
- package/dist/frontmatter.d.ts +0 -15
- package/dist/frontmatter.d.ts.map +0 -1
- package/dist/frontmatter.js +0 -46
- package/dist/frontmatter.js.map +0 -1
- package/dist/test/test/frontmatter.test.d.ts +0 -2
- package/dist/test/test/frontmatter.test.d.ts.map +0 -1
- package/dist/test/test/frontmatter.test.js +0 -55
- package/dist/test/test/frontmatter.test.js.map +0 -1
|
@@ -1,105 +1,58 @@
|
|
|
1
|
-
> This is one page of the CE.SDK
|
|
1
|
+
> This is one page of the CE.SDK Node.js documentation. For a complete overview, see the [Node.js Documentation Index](https://img.ly/docs/cesdk/node.md). For all docs in one file, see [llms-full.txt](./llms-full.txt.md).
|
|
2
2
|
|
|
3
3
|
**Navigation:** [Guides](./guides.md) > [Create and Edit Text](./text.md) > [Text Designs](./text/text-designs.md)
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Create and customize text designs (text components)
|
|
8
|
-
|
|
9
|
-

|
|
7
|
+
Create and customize text designs (text components) programmatically in a headless server environment for batch processing and automation.
|
|
10
8
|
|
|
11
9
|
> **Reading time:** 10 minutes
|
|
12
10
|
>
|
|
13
11
|
> **Resources:**
|
|
14
12
|
>
|
|
15
13
|
> - [Download examples](https://github.com/imgly/cesdk-web-examples/archive/refs/tags/release-$UBQ_VERSION$.zip)
|
|
16
|
-
>
|
|
17
|
-
> - [
|
|
18
|
-
>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```typescript file=@cesdk_web_examples/guides-text-text-designs-browser/browser.ts reference-only
|
|
23
|
-
import type { EditorPlugin, EditorPluginContext } from '@cesdk/cesdk-js';
|
|
24
|
-
|
|
25
|
-
import {
|
|
26
|
-
BlurAssetSource,
|
|
27
|
-
ColorPaletteAssetSource,
|
|
28
|
-
CropPresetsAssetSource,
|
|
29
|
-
DemoAssetSources,
|
|
30
|
-
EffectsAssetSource,
|
|
31
|
-
FiltersAssetSource,
|
|
32
|
-
PagePresetsAssetSource,
|
|
33
|
-
StickerAssetSource,
|
|
34
|
-
TextAssetSource,
|
|
35
|
-
TextComponentAssetSource,
|
|
36
|
-
TypefaceAssetSource,
|
|
37
|
-
UploadAssetSources,
|
|
38
|
-
VectorShapeAssetSource
|
|
39
|
-
} from '@cesdk/cesdk-js/plugins';
|
|
40
|
-
import { DesignEditorConfig } from './design-editor/plugin';
|
|
41
|
-
import packageJson from './package.json';
|
|
42
|
-
// Import the pre-generated thumbnail for the asset library
|
|
43
|
-
import customTitleThumbnail from './assets/custom-title-thumbnail.png';
|
|
14
|
+
>
|
|
15
|
+
> - [View source on GitHub](https://github.com/imgly/cesdk-web-examples/tree/release-$UBQ_VERSION$/guides-text-text-designs-server-js)
|
|
16
|
+
>
|
|
17
|
+
> - [Open in StackBlitz](https://stackblitz.com/github/imgly/cesdk-web-examples/tree/v$UBQ_VERSION$/guides-text-text-designs-server-js)
|
|
18
|
+
|
|
19
|
+
Text designs (also known as text components) are pre-designed text layouts stored as serialized blocks in the asset library. This guide shows how to create custom text components using the headless engine for server-side generation and batch processing.
|
|
44
20
|
|
|
21
|
+
```typescript file=@cesdk_web_examples/guides-text-text-designs-server-js/server-js.ts reference-only
|
|
45
22
|
/**
|
|
46
|
-
* CE.SDK
|
|
23
|
+
* CE.SDK Server Guide: Text Designs
|
|
47
24
|
*
|
|
48
25
|
* Demonstrates how to create and register custom text designs (text components):
|
|
49
26
|
* - Create styled text blocks programmatically
|
|
50
|
-
* -
|
|
27
|
+
* - Save components as archives with block.saveToArchive()
|
|
51
28
|
* - Generate thumbnails with block.export()
|
|
52
|
-
* -
|
|
29
|
+
* - Create content.json structure for custom asset sources
|
|
53
30
|
*
|
|
54
31
|
* The saveToArchive() method creates a zip archive containing the blocks.blocks file
|
|
55
|
-
* and all referenced resources (fonts, images).
|
|
56
|
-
*
|
|
32
|
+
* and all referenced resources (fonts, images). Extract this archive and serve the
|
|
33
|
+
* files. Use block.loadFromURL() pointing to the blocks.blocks file to load components.
|
|
57
34
|
*/
|
|
58
|
-
class Example implements EditorPlugin {
|
|
59
|
-
name = packageJson.name;
|
|
60
35
|
|
|
61
|
-
|
|
36
|
+
import CreativeEngine from '@cesdk/node';
|
|
37
|
+
import { writeFileSync, mkdirSync, existsSync } from 'fs';
|
|
38
|
+
import { config } from 'dotenv';
|
|
62
39
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
throw new Error('CE.SDK instance is required for this plugin');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
await cesdk.addPlugin(new DesignEditorConfig());
|
|
40
|
+
// Load environment variables from .env file
|
|
41
|
+
config();
|
|
69
42
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
new UploadAssetSources({ include: ['ly.img.image.upload'] })
|
|
76
|
-
);
|
|
77
|
-
await cesdk.addPlugin(
|
|
78
|
-
new DemoAssetSources({
|
|
79
|
-
include: [
|
|
80
|
-
'ly.img.templates.blank.*',
|
|
81
|
-
'ly.img.templates.presentation.*',
|
|
82
|
-
'ly.img.templates.print.*',
|
|
83
|
-
'ly.img.templates.social.*',
|
|
84
|
-
'ly.img.image.*'
|
|
85
|
-
]
|
|
86
|
-
})
|
|
87
|
-
);
|
|
88
|
-
await cesdk.addPlugin(new EffectsAssetSource());
|
|
89
|
-
await cesdk.addPlugin(new FiltersAssetSource());
|
|
90
|
-
await cesdk.addPlugin(new PagePresetsAssetSource());
|
|
91
|
-
await cesdk.addPlugin(new StickerAssetSource());
|
|
92
|
-
await cesdk.addPlugin(new TextAssetSource());
|
|
93
|
-
await cesdk.addPlugin(new TextComponentAssetSource());
|
|
94
|
-
await cesdk.addPlugin(new TypefaceAssetSource());
|
|
95
|
-
await cesdk.addPlugin(new VectorShapeAssetSource());
|
|
96
|
-
|
|
97
|
-
await cesdk.actions.run('scene.create', {
|
|
98
|
-
page: { width: 800, height: 600, unit: 'Pixel' }
|
|
99
|
-
});
|
|
43
|
+
async function main(): Promise<void> {
|
|
44
|
+
const engine = await CreativeEngine.init({
|
|
45
|
+
baseURL: process.env.IMGLY_LOCAL_ASSETS_URL
|
|
46
|
+
// license: process.env.CESDK_LICENSE,
|
|
47
|
+
});
|
|
100
48
|
|
|
101
|
-
|
|
102
|
-
|
|
49
|
+
try {
|
|
50
|
+
// Create a scene with a page to hold our text components
|
|
51
|
+
const scene = engine.scene.create();
|
|
52
|
+
const page = engine.block.create('page');
|
|
53
|
+
engine.block.appendChild(scene, page);
|
|
54
|
+
engine.block.setWidth(page, 800);
|
|
55
|
+
engine.block.setHeight(page, 600);
|
|
103
56
|
|
|
104
57
|
// Create a styled text block that will become our custom component
|
|
105
58
|
const textComponent = engine.block.create('text');
|
|
@@ -153,46 +106,27 @@ class Example implements EditorPlugin {
|
|
|
153
106
|
);
|
|
154
107
|
|
|
155
108
|
// Configure constraints for flexible resizing
|
|
156
|
-
// These ensure the component maintains proper proportions when resized
|
|
157
|
-
|
|
158
109
|
// Enable automatic font sizing within constraints
|
|
159
110
|
engine.block.setBool(textComponent, 'text/automaticFontSizeEnabled', true);
|
|
160
111
|
engine.block.setFloat(textComponent, 'text/minAutomaticFontSize', 24);
|
|
161
112
|
engine.block.setFloat(textComponent, 'text/maxAutomaticFontSize', 120);
|
|
162
113
|
|
|
163
|
-
//
|
|
164
|
-
|
|
165
|
-
engine.block.setColor(textComponent, 'backgroundColor/color', {
|
|
166
|
-
r: 0.95,
|
|
167
|
-
g: 0.95,
|
|
168
|
-
b: 1.0,
|
|
169
|
-
a: 1.0
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
// Serialize the text component using saveToArchive()
|
|
173
|
-
// This creates a zip archive containing blocks.blocks and all resources (fonts, images)
|
|
114
|
+
// Save the component to a blocks archive file
|
|
115
|
+
// saveToArchive() returns a Blob containing a zip with blocks.blocks and resources
|
|
174
116
|
const archiveBlob = await engine.block.saveToArchive([textComponent]);
|
|
175
117
|
console.log('Archive size:', archiveBlob.size, 'bytes');
|
|
176
118
|
|
|
177
|
-
//
|
|
178
|
-
//
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
// targetWidth: 400,
|
|
186
|
-
// targetHeight: 320
|
|
187
|
-
// });
|
|
188
|
-
//
|
|
189
|
-
// For this example, we use a pre-generated thumbnail to avoid
|
|
190
|
-
// watermarks when running without a license key.
|
|
191
|
-
// Prepend origin to make it an absolute URL (CE.SDK prepends its base URL to relative paths)
|
|
192
|
-
const thumbnailUri = window.location.origin + customTitleThumbnail;
|
|
119
|
+
// Generate a thumbnail for the text component
|
|
120
|
+
// Thumbnails should be 400x320px for the asset library
|
|
121
|
+
const thumbnailBlob = await engine.block.export(textComponent, {
|
|
122
|
+
mimeType: 'image/png',
|
|
123
|
+
targetWidth: 400,
|
|
124
|
+
targetHeight: 320
|
|
125
|
+
});
|
|
126
|
+
console.log('Thumbnail size:', thumbnailBlob.size, 'bytes');
|
|
193
127
|
|
|
194
|
-
// Create the content.json structure for the custom
|
|
195
|
-
//
|
|
128
|
+
// Create the content.json structure for the custom components
|
|
129
|
+
// The uri points to the blocks.blocks file within the extracted archive directory
|
|
196
130
|
const contentJson = {
|
|
197
131
|
version: '3.0.0',
|
|
198
132
|
id: 'my.custom.textComponents',
|
|
@@ -203,119 +137,89 @@ class Example implements EditorPlugin {
|
|
|
203
137
|
en: 'Custom Title'
|
|
204
138
|
},
|
|
205
139
|
meta: {
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
|
|
140
|
+
// URI points to blocks.blocks within the extracted archive directory
|
|
141
|
+
// The {{base_url}} placeholder is replaced with your configured base URL
|
|
142
|
+
uri: '{{base_url}}/my.custom.textComponents/data/customTitle/blocks.blocks',
|
|
143
|
+
thumbUri:
|
|
144
|
+
'{{base_url}}/my.custom.textComponents/thumbnails/customTitle.png',
|
|
145
|
+
mimeType: 'application/ubq-blocks-string'
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: '//my.custom.textComponents/promo',
|
|
150
|
+
label: {
|
|
151
|
+
en: 'Promo'
|
|
152
|
+
},
|
|
153
|
+
meta: {
|
|
154
|
+
uri: '{{base_url}}/my.custom.textComponents/data/promo/blocks.blocks',
|
|
155
|
+
thumbUri:
|
|
156
|
+
'{{base_url}}/my.custom.textComponents/thumbnails/promo.png',
|
|
209
157
|
mimeType: 'application/ubq-blocks-string'
|
|
210
158
|
}
|
|
211
159
|
}
|
|
212
160
|
],
|
|
213
161
|
blocks: []
|
|
214
162
|
};
|
|
215
|
-
console.log(
|
|
216
|
-
|
|
217
|
-
JSON.stringify(contentJson, null, 2)
|
|
218
|
-
);
|
|
219
|
-
|
|
220
|
-
// Register a custom asset source with an apply callback
|
|
221
|
-
// The callback handles loading and inserting blocks when clicked
|
|
222
|
-
|
|
223
|
-
// Store archive URLs in a Map for lookup when applying
|
|
224
|
-
const archiveUrls = new Map<string, string>();
|
|
225
|
-
archiveUrls.set('customTitle', archiveUrl);
|
|
226
|
-
|
|
227
|
-
// Create local source with custom apply callback
|
|
228
|
-
engine.asset.addLocalSource(
|
|
229
|
-
'custom.textComponents',
|
|
230
|
-
undefined, // No MIME type filter
|
|
231
|
-
async (asset) => {
|
|
232
|
-
// Get the archive URL for this asset
|
|
233
|
-
const assetArchiveUrl = archiveUrls.get(asset.id);
|
|
234
|
-
if (!assetArchiveUrl) return undefined;
|
|
235
|
-
|
|
236
|
-
// Load the block from the archive using loadFromArchiveURL()
|
|
237
|
-
const loadedBlocks =
|
|
238
|
-
await engine.block.loadFromArchiveURL(assetArchiveUrl);
|
|
239
|
-
const newBlock = loadedBlocks[0];
|
|
240
|
-
if (!newBlock) return undefined;
|
|
241
|
-
|
|
242
|
-
// Add to the current page and center it
|
|
243
|
-
const currentPage = engine.scene.getCurrentPage();
|
|
244
|
-
if (currentPage) {
|
|
245
|
-
engine.block.appendChild(currentPage, newBlock);
|
|
246
|
-
// Center the block on the page
|
|
247
|
-
const pageWidth = engine.block.getWidth(currentPage);
|
|
248
|
-
const pageHeight = engine.block.getHeight(currentPage);
|
|
249
|
-
const blockWidth = engine.block.getWidth(newBlock);
|
|
250
|
-
const blockHeight = engine.block.getHeight(newBlock);
|
|
251
|
-
engine.block.setPositionX(newBlock, (pageWidth - blockWidth) / 2);
|
|
252
|
-
engine.block.setPositionY(newBlock, (pageHeight - blockHeight) / 2);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
engine.editor.addUndoStep();
|
|
256
|
-
return newBlock;
|
|
257
|
-
}
|
|
258
|
-
);
|
|
163
|
+
console.log('Content.json structure:');
|
|
164
|
+
console.log(JSON.stringify(contentJson, null, 2));
|
|
259
165
|
|
|
260
|
-
//
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
thumbUri: thumbnailUri,
|
|
266
|
-
mimeType: 'application/ubq-blocks-string'
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
console.log('Custom text components asset source registered');
|
|
166
|
+
// Save the archive, thumbnail, and content.json to files
|
|
167
|
+
// Create output directory structure
|
|
168
|
+
const outputDir = './output';
|
|
169
|
+
const dataDir = `${outputDir}/data`;
|
|
170
|
+
const thumbnailsDir = `${outputDir}/thumbnails`;
|
|
270
171
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
172
|
+
if (!existsSync(outputDir)) {
|
|
173
|
+
mkdirSync(outputDir, { recursive: true });
|
|
174
|
+
}
|
|
175
|
+
if (!existsSync(dataDir)) {
|
|
176
|
+
mkdirSync(dataDir, { recursive: true });
|
|
177
|
+
}
|
|
178
|
+
if (!existsSync(thumbnailsDir)) {
|
|
179
|
+
mkdirSync(thumbnailsDir, { recursive: true });
|
|
180
|
+
}
|
|
276
181
|
|
|
277
|
-
//
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
});
|
|
182
|
+
// Save the archive as a zip file
|
|
183
|
+
// Extract this archive to get the blocks.blocks file and any resources (fonts, images)
|
|
184
|
+
// After extraction, the directory structure should be:
|
|
185
|
+
// data/customTitle/blocks.blocks
|
|
186
|
+
// data/customTitle/fonts/... (if any custom fonts)
|
|
187
|
+
// data/customTitle/images/... (if any images)
|
|
188
|
+
const archivePath = `${dataDir}/customTitle.zip`;
|
|
189
|
+
const archiveBuffer = Buffer.from(await archiveBlob.arrayBuffer());
|
|
190
|
+
writeFileSync(archivePath, archiveBuffer);
|
|
191
|
+
console.log(`Saved archive to: ${archivePath}`);
|
|
192
|
+
console.log(
|
|
193
|
+
'Extract this archive to create the data/customTitle/ directory'
|
|
194
|
+
);
|
|
287
195
|
|
|
288
|
-
//
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
id: 'ly.img.assetLibrary.dock',
|
|
294
|
-
key: 'text-components-dock',
|
|
295
|
-
label: 'Text Components',
|
|
296
|
-
icon: '@imgly/Type',
|
|
297
|
-
entries: ['text-components-entry']
|
|
298
|
-
}
|
|
299
|
-
]);
|
|
196
|
+
// Save the thumbnail
|
|
197
|
+
const thumbnailPath = `${thumbnailsDir}/customTitle.png`;
|
|
198
|
+
const thumbnailBuffer = Buffer.from(await thumbnailBlob.arrayBuffer());
|
|
199
|
+
writeFileSync(thumbnailPath, thumbnailBuffer);
|
|
200
|
+
console.log(`Saved thumbnail to: ${thumbnailPath}`);
|
|
300
201
|
|
|
301
|
-
//
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
});
|
|
202
|
+
// Save the content.json
|
|
203
|
+
const contentJsonPath = `${outputDir}/content.json`;
|
|
204
|
+
writeFileSync(contentJsonPath, JSON.stringify(contentJson, null, 2));
|
|
205
|
+
console.log(`Saved content.json to: ${contentJsonPath}`);
|
|
305
206
|
|
|
306
|
-
//
|
|
307
|
-
|
|
308
|
-
engine.
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
207
|
+
// In production, host the files and register the asset source from a URL:
|
|
208
|
+
//
|
|
209
|
+
// await engine.asset.addLocalAssetSourceFromJSON(
|
|
210
|
+
// new URL('https://your-server.com/my.custom.textComponents/content.json')
|
|
211
|
+
// );
|
|
212
|
+
//
|
|
213
|
+
// The SDK will then use block.loadFromURL() to load components from
|
|
214
|
+
// the URIs specified in content.json (e.g., data/customTitle/blocks.blocks)
|
|
215
|
+
console.log('\nTo use these components in production:');
|
|
216
|
+
console.log('1. Extract the archives:');
|
|
217
|
+
console.log(' unzip data/customTitle.zip -d data/customTitle/');
|
|
218
|
+
console.log(' unzip data/promo.zip -d data/promo/');
|
|
219
|
+
console.log('2. Host the output directory on your server');
|
|
220
|
+
console.log(
|
|
221
|
+
'3. Register with: engine.asset.addLocalAssetSourceFromJSON(new URL(contentJsonUrl))'
|
|
314
222
|
);
|
|
315
|
-
engine.block.setFloat(label, 'text/fontSize', 54);
|
|
316
|
-
engine.block.setTextColor(label, { r: 0.4, g: 0.4, b: 0.4, a: 1.0 });
|
|
317
|
-
engine.block.setPositionX(label, 50);
|
|
318
|
-
engine.block.setPositionY(label, 200);
|
|
319
223
|
|
|
320
224
|
// Create a second example component with different styling
|
|
321
225
|
const promoComponent = engine.block.create('text');
|
|
@@ -354,127 +258,125 @@ class Example implements EditorPlugin {
|
|
|
354
258
|
engine.block.setHeight(promoComponent, 120);
|
|
355
259
|
engine.block.setBool(promoComponent, 'clipped', true);
|
|
356
260
|
|
|
357
|
-
// Add background
|
|
358
|
-
engine.block.setBool(promoComponent, 'backgroundColor/enabled', true);
|
|
359
|
-
engine.block.setColor(promoComponent, 'backgroundColor/color', {
|
|
360
|
-
r: 1.0,
|
|
361
|
-
g: 0.95,
|
|
362
|
-
b: 0.9,
|
|
363
|
-
a: 1.0
|
|
364
|
-
});
|
|
365
|
-
|
|
366
261
|
engine.block.setPositionX(promoComponent, 50);
|
|
367
|
-
engine.block.setPositionY(promoComponent,
|
|
262
|
+
engine.block.setPositionY(promoComponent, 200);
|
|
368
263
|
|
|
369
|
-
//
|
|
370
|
-
engine.block.
|
|
264
|
+
// Save the promo component as an archive
|
|
265
|
+
const promoArchiveBlob = await engine.block.saveToArchive([promoComponent]);
|
|
266
|
+
const promoArchiveBuffer = Buffer.from(
|
|
267
|
+
await promoArchiveBlob.arrayBuffer()
|
|
268
|
+
);
|
|
269
|
+
writeFileSync(`${dataDir}/promo.zip`, promoArchiveBuffer);
|
|
270
|
+
console.log(`Saved promo archive to: ${dataDir}/promo.zip`);
|
|
271
|
+
|
|
272
|
+
// Export promo thumbnail
|
|
273
|
+
const promoThumbnail = await engine.block.export(promoComponent, {
|
|
274
|
+
mimeType: 'image/png',
|
|
275
|
+
targetWidth: 400,
|
|
276
|
+
targetHeight: 320
|
|
277
|
+
});
|
|
278
|
+
const promoThumbnailBuffer = Buffer.from(
|
|
279
|
+
await promoThumbnail.arrayBuffer()
|
|
280
|
+
);
|
|
281
|
+
writeFileSync(`${thumbnailsDir}/promo.png`, promoThumbnailBuffer);
|
|
282
|
+
console.log(`Saved promo thumbnail to: ${thumbnailsDir}/promo.png`);
|
|
283
|
+
|
|
284
|
+
console.log('\nFont combinations created successfully!');
|
|
285
|
+
console.log('Output files are in:', outputDir);
|
|
286
|
+
} finally {
|
|
287
|
+
// Always dispose of the engine to free resources
|
|
288
|
+
engine.dispose();
|
|
371
289
|
}
|
|
372
290
|
}
|
|
373
291
|
|
|
374
|
-
|
|
292
|
+
main().catch(console.error);
|
|
375
293
|
```
|
|
376
294
|
|
|
377
|
-
This guide covers creating styled text components, serializing them for storage, generating thumbnails, and
|
|
295
|
+
This guide covers creating styled text components, serializing them for storage, generating thumbnails, and saving files for deployment.
|
|
378
296
|
|
|
379
|
-
## Setting Up the
|
|
297
|
+
## Setting Up the Engine
|
|
380
298
|
|
|
381
|
-
We initialize
|
|
299
|
+
We initialize the headless engine for server-side text component generation. The engine runs without a UI, making it ideal for batch processing.
|
|
382
300
|
|
|
383
301
|
```typescript highlight=highlight-setup
|
|
384
|
-
await
|
|
385
|
-
|
|
386
|
-
//
|
|
387
|
-
await cesdk.addPlugin(new BlurAssetSource());
|
|
388
|
-
await cesdk.addPlugin(new ColorPaletteAssetSource());
|
|
389
|
-
await cesdk.addPlugin(new CropPresetsAssetSource());
|
|
390
|
-
await cesdk.addPlugin(
|
|
391
|
-
new UploadAssetSources({ include: ['ly.img.image.upload'] })
|
|
392
|
-
);
|
|
393
|
-
await cesdk.addPlugin(
|
|
394
|
-
new DemoAssetSources({
|
|
395
|
-
include: [
|
|
396
|
-
'ly.img.templates.blank.*',
|
|
397
|
-
'ly.img.templates.presentation.*',
|
|
398
|
-
'ly.img.templates.print.*',
|
|
399
|
-
'ly.img.templates.social.*',
|
|
400
|
-
'ly.img.image.*'
|
|
401
|
-
]
|
|
402
|
-
})
|
|
403
|
-
);
|
|
404
|
-
await cesdk.addPlugin(new EffectsAssetSource());
|
|
405
|
-
await cesdk.addPlugin(new FiltersAssetSource());
|
|
406
|
-
await cesdk.addPlugin(new PagePresetsAssetSource());
|
|
407
|
-
await cesdk.addPlugin(new StickerAssetSource());
|
|
408
|
-
await cesdk.addPlugin(new TextAssetSource());
|
|
409
|
-
await cesdk.addPlugin(new TextComponentAssetSource());
|
|
410
|
-
await cesdk.addPlugin(new TypefaceAssetSource());
|
|
411
|
-
await cesdk.addPlugin(new VectorShapeAssetSource());
|
|
412
|
-
|
|
413
|
-
await cesdk.actions.run('scene.create', {
|
|
414
|
-
page: { width: 800, height: 600, unit: 'Pixel' }
|
|
302
|
+
const engine = await CreativeEngine.init({
|
|
303
|
+
baseURL: process.env.IMGLY_LOCAL_ASSETS_URL
|
|
304
|
+
// license: process.env.CESDK_LICENSE,
|
|
415
305
|
});
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Always dispose of the engine when finished to free system resources.
|
|
309
|
+
|
|
310
|
+
## Creating a Scene
|
|
416
311
|
|
|
417
|
-
|
|
418
|
-
|
|
312
|
+
We create a scene with a page to hold our text components. The page dimensions define the canvas where we build components.
|
|
313
|
+
|
|
314
|
+
```typescript highlight=highlight-create-scene
|
|
315
|
+
// Create a scene with a page to hold our text components
|
|
316
|
+
const scene = engine.scene.create();
|
|
317
|
+
const page = engine.block.create('page');
|
|
318
|
+
engine.block.appendChild(scene, page);
|
|
319
|
+
engine.block.setWidth(page, 800);
|
|
320
|
+
engine.block.setHeight(page, 600);
|
|
419
321
|
```
|
|
420
322
|
|
|
421
|
-
|
|
323
|
+
The page provides a container for positioning and styling text components.
|
|
422
324
|
|
|
423
325
|
## Creating a Text Component
|
|
424
326
|
|
|
425
|
-
We create a text block and configure its styling, dimensions, and position. The component uses fixed frame dimensions with clipping enabled to ensure consistent display. We set an explicit font using the `setFont()` API.
|
|
327
|
+
We create a text block and configure its styling, dimensions, and position. The component uses fixed frame dimensions with clipping enabled to ensure consistent display. We set an explicit font using external CDN URLs with the `setFont()` API.
|
|
426
328
|
|
|
427
329
|
```typescript highlight=highlight-create-text-component
|
|
428
|
-
// Create a styled text block that will become our custom component
|
|
429
|
-
const textComponent = engine.block.create('text');
|
|
430
|
-
engine.block.appendChild(page, textComponent);
|
|
431
|
-
|
|
432
|
-
// Set text content and styling
|
|
433
|
-
engine.block.replaceText(textComponent, 'Custom Title');
|
|
434
|
-
engine.block.setFloat(textComponent, 'text/fontSize', 72);
|
|
435
|
-
|
|
436
|
-
// Set text color to a brand color
|
|
437
|
-
engine.block.setTextColor(textComponent, {
|
|
438
|
-
r: 0.2,
|
|
439
|
-
g: 0.4,
|
|
440
|
-
b: 0.8,
|
|
441
|
-
a: 1.0
|
|
442
|
-
});
|
|
330
|
+
// Create a styled text block that will become our custom component
|
|
331
|
+
const textComponent = engine.block.create('text');
|
|
332
|
+
engine.block.appendChild(page, textComponent);
|
|
443
333
|
|
|
444
|
-
//
|
|
445
|
-
engine.block.
|
|
446
|
-
engine.block.
|
|
447
|
-
engine.block.setWidth(textComponent, 400);
|
|
448
|
-
engine.block.setHeight(textComponent, 100);
|
|
449
|
-
engine.block.setBool(textComponent, 'clipped', true);
|
|
450
|
-
|
|
451
|
-
// Position the component on the page
|
|
452
|
-
engine.block.setPositionX(textComponent, 50);
|
|
453
|
-
engine.block.setPositionY(textComponent, 50);
|
|
454
|
-
|
|
455
|
-
// Define a custom typeface
|
|
456
|
-
// With saveToArchive(), fonts are automatically bundled in the archive
|
|
457
|
-
// You can use any font - CDN URLs, bundle:// URIs, or custom fonts
|
|
458
|
-
const caveatTypeface = {
|
|
459
|
-
name: 'Caveat',
|
|
460
|
-
fonts: [
|
|
461
|
-
{
|
|
462
|
-
uri: 'https://cdn.img.ly/assets/v3/ly.img.typeface/fonts/Caveat/Caveat-Regular.ttf',
|
|
463
|
-
subFamily: 'Regular'
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
uri: 'https://cdn.img.ly/assets/v3/ly.img.typeface/fonts/Caveat/Caveat-Bold.ttf',
|
|
467
|
-
subFamily: 'Bold'
|
|
468
|
-
}
|
|
469
|
-
]
|
|
470
|
-
};
|
|
334
|
+
// Set text content and styling
|
|
335
|
+
engine.block.replaceText(textComponent, 'Custom Title');
|
|
336
|
+
engine.block.setFloat(textComponent, 'text/fontSize', 72);
|
|
471
337
|
|
|
472
|
-
// Set
|
|
473
|
-
engine.block.
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
338
|
+
// Set text color to a brand color
|
|
339
|
+
engine.block.setTextColor(textComponent, {
|
|
340
|
+
r: 0.2,
|
|
341
|
+
g: 0.4,
|
|
342
|
+
b: 0.8,
|
|
343
|
+
a: 1.0
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
// Configure dimensions - use fixed frame with clipping
|
|
347
|
+
engine.block.setWidthMode(textComponent, 'Absolute');
|
|
348
|
+
engine.block.setHeightMode(textComponent, 'Absolute');
|
|
349
|
+
engine.block.setWidth(textComponent, 400);
|
|
350
|
+
engine.block.setHeight(textComponent, 100);
|
|
351
|
+
engine.block.setBool(textComponent, 'clipped', true);
|
|
352
|
+
|
|
353
|
+
// Position the component on the page
|
|
354
|
+
engine.block.setPositionX(textComponent, 50);
|
|
355
|
+
engine.block.setPositionY(textComponent, 50);
|
|
356
|
+
|
|
357
|
+
// Define a custom typeface
|
|
358
|
+
// With saveToArchive(), fonts are automatically bundled in the archive
|
|
359
|
+
// You can use any font - CDN URLs, bundle:// URIs, or custom fonts
|
|
360
|
+
const caveatTypeface = {
|
|
361
|
+
name: 'Caveat',
|
|
362
|
+
fonts: [
|
|
363
|
+
{
|
|
364
|
+
uri: 'https://cdn.img.ly/assets/v3/ly.img.typeface/fonts/Caveat/Caveat-Regular.ttf',
|
|
365
|
+
subFamily: 'Regular'
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
uri: 'https://cdn.img.ly/assets/v3/ly.img.typeface/fonts/Caveat/Caveat-Bold.ttf',
|
|
369
|
+
subFamily: 'Bold'
|
|
370
|
+
}
|
|
371
|
+
]
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
// Set the font - saveToArchive() will include the font files in the archive
|
|
375
|
+
engine.block.setFont(
|
|
376
|
+
textComponent,
|
|
377
|
+
caveatTypeface.fonts[0].uri,
|
|
378
|
+
caveatTypeface
|
|
379
|
+
);
|
|
478
380
|
```
|
|
479
381
|
|
|
480
382
|
The text block now has custom styling including font size, color, and fixed dimensions. The `clipped` property ensures text that exceeds the frame boundaries is hidden. With `saveToArchive()`, fonts are automatically bundled in the archive, so you can use any font source.
|
|
@@ -485,21 +387,10 @@ We configure the text component with automatic font sizing and constraints. This
|
|
|
485
387
|
|
|
486
388
|
```typescript highlight=highlight-configure-constraints
|
|
487
389
|
// Configure constraints for flexible resizing
|
|
488
|
-
// These ensure the component maintains proper proportions when resized
|
|
489
|
-
|
|
490
390
|
// Enable automatic font sizing within constraints
|
|
491
391
|
engine.block.setBool(textComponent, 'text/automaticFontSizeEnabled', true);
|
|
492
392
|
engine.block.setFloat(textComponent, 'text/minAutomaticFontSize', 24);
|
|
493
393
|
engine.block.setFloat(textComponent, 'text/maxAutomaticFontSize', 120);
|
|
494
|
-
|
|
495
|
-
// Add a background to visualize the text frame
|
|
496
|
-
engine.block.setBool(textComponent, 'backgroundColor/enabled', true);
|
|
497
|
-
engine.block.setColor(textComponent, 'backgroundColor/color', {
|
|
498
|
-
r: 0.95,
|
|
499
|
-
g: 0.95,
|
|
500
|
-
b: 1.0,
|
|
501
|
-
a: 1.0
|
|
502
|
-
});
|
|
503
394
|
```
|
|
504
395
|
|
|
505
396
|
The automatic font sizing scales text between 24pt and 120pt as the frame is resized.
|
|
@@ -509,17 +400,13 @@ The automatic font sizing scales text between 24pt and 120pt as the frame is res
|
|
|
509
400
|
We serialize the text component using `saveToArchive()`. This creates a zip archive containing the `blocks.blocks` file and all referenced resources (fonts, images). The archive is self-contained and portable.
|
|
510
401
|
|
|
511
402
|
```typescript highlight=highlight-serialize-component
|
|
512
|
-
//
|
|
513
|
-
//
|
|
403
|
+
// Save the component to a blocks archive file
|
|
404
|
+
// saveToArchive() returns a Blob containing a zip with blocks.blocks and resources
|
|
514
405
|
const archiveBlob = await engine.block.saveToArchive([textComponent]);
|
|
515
406
|
console.log('Archive size:', archiveBlob.size, 'bytes');
|
|
516
|
-
|
|
517
|
-
// Create a Blob URL for in-memory loading
|
|
518
|
-
// In production, you would extract the archive and host the files on your server
|
|
519
|
-
const archiveUrl = URL.createObjectURL(archiveBlob);
|
|
520
407
|
```
|
|
521
408
|
|
|
522
|
-
|
|
409
|
+
The archive blob can be saved as a `.zip` file. Extract the archive before deployment to create the directory structure needed for hosting.
|
|
523
410
|
|
|
524
411
|
## Legacy: Using saveToString()
|
|
525
412
|
|
|
@@ -529,10 +416,13 @@ For backward compatibility, you can use `saveToString()` instead of `saveToArchi
|
|
|
529
416
|
// Legacy approach - requires external font URLs
|
|
530
417
|
const serializedComponent = await engine.block.saveToString(
|
|
531
418
|
[textComponent],
|
|
532
|
-
['bundle', 'buffer', 'http', 'https']
|
|
419
|
+
['bundle', 'buffer', 'http', 'https'] // Allowed resource schemes
|
|
533
420
|
);
|
|
534
421
|
|
|
535
|
-
//
|
|
422
|
+
// Save as .blocks file
|
|
423
|
+
writeFileSync(`${outputDir}/customTitle.blocks`, serializedComponent);
|
|
424
|
+
|
|
425
|
+
// Load with loadFromString() or loadFromURL()
|
|
536
426
|
const loadedBlocks = await engine.block.loadFromString(serializedComponent);
|
|
537
427
|
```
|
|
538
428
|
|
|
@@ -544,68 +434,30 @@ const loadedBlocks = await engine.block.loadFromString(serializedComponent);
|
|
|
544
434
|
|
|
545
435
|
We recommend `saveToArchive()` for new implementations as it bundles all resources automatically.
|
|
546
436
|
|
|
547
|
-
## Hosting for Production
|
|
548
|
-
|
|
549
|
-
For production deployments, extract the archive and host the files on your web server. Maintain the following directory structure:
|
|
550
|
-
|
|
551
|
-
```
|
|
552
|
-
/ly.img.text.components/
|
|
553
|
-
├── content.json
|
|
554
|
-
├── data/
|
|
555
|
-
│ ├── customTitle/
|
|
556
|
-
│ │ └── blocks.blocks
|
|
557
|
-
│ ├── customHeading/
|
|
558
|
-
│ │ ├── blocks.blocks
|
|
559
|
-
│ │ ├── fonts/
|
|
560
|
-
│ │ │ └── 59251598.ttf
|
|
561
|
-
│ │ └── images/
|
|
562
|
-
│ │ └── 3255389386.jpeg
|
|
563
|
-
│ └── ...
|
|
564
|
-
└── thumbnails/
|
|
565
|
-
├── customTitle.png
|
|
566
|
-
├── customHeading.png
|
|
567
|
-
└── ...
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
Simple components contain only `blocks.blocks`. Components with custom fonts or images include additional subdirectories. The archive structure mirrors this layout - extract it directly to your server.
|
|
571
|
-
|
|
572
|
-
Update the `uri` paths in `content.json` to point to your hosted files:
|
|
573
|
-
|
|
574
|
-
```json
|
|
575
|
-
{
|
|
576
|
-
"uri": "https://your-server.com/ly.img.text.components/data/customTitle/blocks.blocks",
|
|
577
|
-
"thumbUri": "https://your-server.com/ly.img.text.components/thumbnails/customTitle.png"
|
|
578
|
-
}
|
|
579
|
-
```
|
|
580
|
-
|
|
581
437
|
## Generating a Thumbnail
|
|
582
438
|
|
|
583
|
-
|
|
439
|
+
We generate a 400x320px thumbnail for the asset library using `block.export()`. Thumbnails help users preview components before inserting them.
|
|
584
440
|
|
|
585
441
|
```typescript highlight=highlight-generate-thumbnail
|
|
586
|
-
//
|
|
587
|
-
//
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
// For this example, we use a pre-generated thumbnail to avoid
|
|
595
|
-
// watermarks when running without a license key.
|
|
596
|
-
// Prepend origin to make it an absolute URL (CE.SDK prepends its base URL to relative paths)
|
|
597
|
-
const thumbnailUri = window.location.origin + customTitleThumbnail;
|
|
442
|
+
// Generate a thumbnail for the text component
|
|
443
|
+
// Thumbnails should be 400x320px for the asset library
|
|
444
|
+
const thumbnailBlob = await engine.block.export(textComponent, {
|
|
445
|
+
mimeType: 'image/png',
|
|
446
|
+
targetWidth: 400,
|
|
447
|
+
targetHeight: 320
|
|
448
|
+
});
|
|
449
|
+
console.log('Thumbnail size:', thumbnailBlob.size, 'bytes');
|
|
598
450
|
```
|
|
599
451
|
|
|
600
|
-
|
|
452
|
+
The thumbnail blob can be converted to a buffer and saved as a PNG file.
|
|
601
453
|
|
|
602
454
|
## Creating the Content.json Structure
|
|
603
455
|
|
|
604
456
|
We create the content.json structure that defines the asset source. This file lists all components with their metadata, including paths to the serialized blocks and thumbnails.
|
|
605
457
|
|
|
606
458
|
```typescript highlight=highlight-create-content-json
|
|
607
|
-
// Create the content.json structure for the custom
|
|
608
|
-
//
|
|
459
|
+
// Create the content.json structure for the custom components
|
|
460
|
+
// The uri points to the blocks.blocks file within the extracted archive directory
|
|
609
461
|
const contentJson = {
|
|
610
462
|
version: '3.0.0',
|
|
611
463
|
id: 'my.custom.textComponents',
|
|
@@ -616,219 +468,228 @@ const contentJson = {
|
|
|
616
468
|
en: 'Custom Title'
|
|
617
469
|
},
|
|
618
470
|
meta: {
|
|
619
|
-
//
|
|
620
|
-
//
|
|
621
|
-
|
|
471
|
+
// URI points to blocks.blocks within the extracted archive directory
|
|
472
|
+
// The {{base_url}} placeholder is replaced with your configured base URL
|
|
473
|
+
uri: '{{base_url}}/my.custom.textComponents/data/customTitle/blocks.blocks',
|
|
474
|
+
thumbUri:
|
|
475
|
+
'{{base_url}}/my.custom.textComponents/thumbnails/customTitle.png',
|
|
476
|
+
mimeType: 'application/ubq-blocks-string'
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
id: '//my.custom.textComponents/promo',
|
|
481
|
+
label: {
|
|
482
|
+
en: 'Promo'
|
|
483
|
+
},
|
|
484
|
+
meta: {
|
|
485
|
+
uri: '{{base_url}}/my.custom.textComponents/data/promo/blocks.blocks',
|
|
486
|
+
thumbUri:
|
|
487
|
+
'{{base_url}}/my.custom.textComponents/thumbnails/promo.png',
|
|
622
488
|
mimeType: 'application/ubq-blocks-string'
|
|
623
489
|
}
|
|
624
490
|
}
|
|
625
491
|
],
|
|
626
492
|
blocks: []
|
|
627
493
|
};
|
|
628
|
-
console.log('Content.json structure:'
|
|
494
|
+
console.log('Content.json structure:');
|
|
495
|
+
console.log(JSON.stringify(contentJson, null, 2));
|
|
629
496
|
```
|
|
630
497
|
|
|
631
498
|
In production, the `uri` and `thumbUri` fields point to your hosted files. The `mimeType` must be `"application/ubq-blocks-string"` for text components.
|
|
632
499
|
|
|
633
|
-
##
|
|
634
|
-
|
|
635
|
-
We register a custom asset source using `addLocalSource()` with a custom apply callback. The callback handles loading the block from the archive and inserting it into the scene when users click on a component.
|
|
500
|
+
## Saving Files
|
|
636
501
|
|
|
637
|
-
|
|
638
|
-
// Register a custom asset source with an apply callback
|
|
639
|
-
// The callback handles loading and inserting blocks when clicked
|
|
640
|
-
|
|
641
|
-
// Store archive URLs in a Map for lookup when applying
|
|
642
|
-
const archiveUrls = new Map<string, string>();
|
|
643
|
-
archiveUrls.set('customTitle', archiveUrl);
|
|
644
|
-
|
|
645
|
-
// Create local source with custom apply callback
|
|
646
|
-
engine.asset.addLocalSource(
|
|
647
|
-
'custom.textComponents',
|
|
648
|
-
undefined, // No MIME type filter
|
|
649
|
-
async (asset) => {
|
|
650
|
-
// Get the archive URL for this asset
|
|
651
|
-
const assetArchiveUrl = archiveUrls.get(asset.id);
|
|
652
|
-
if (!assetArchiveUrl) return undefined;
|
|
653
|
-
|
|
654
|
-
// Load the block from the archive using loadFromArchiveURL()
|
|
655
|
-
const loadedBlocks = await engine.block.loadFromArchiveURL(assetArchiveUrl);
|
|
656
|
-
const newBlock = loadedBlocks[0];
|
|
657
|
-
if (!newBlock) return undefined;
|
|
658
|
-
|
|
659
|
-
// Add to the current page and center it
|
|
660
|
-
const currentPage = engine.scene.getCurrentPage();
|
|
661
|
-
if (currentPage) {
|
|
662
|
-
engine.block.appendChild(currentPage, newBlock);
|
|
663
|
-
// Center the block on the page
|
|
664
|
-
const pageWidth = engine.block.getWidth(currentPage);
|
|
665
|
-
const pageHeight = engine.block.getHeight(currentPage);
|
|
666
|
-
const blockWidth = engine.block.getWidth(newBlock);
|
|
667
|
-
const blockHeight = engine.block.getHeight(newBlock);
|
|
668
|
-
engine.block.setPositionX(newBlock, (pageWidth - blockWidth) / 2);
|
|
669
|
-
engine.block.setPositionY(newBlock, (pageHeight - blockHeight) / 2);
|
|
670
|
-
}
|
|
502
|
+
We save the archive, thumbnail, and content.json to the filesystem. The archive is saved as a `.zip` file that must be extracted before deployment.
|
|
671
503
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
504
|
+
```typescript highlight=highlight-save-files
|
|
505
|
+
// Save the archive, thumbnail, and content.json to files
|
|
506
|
+
// Create output directory structure
|
|
507
|
+
const outputDir = './output';
|
|
508
|
+
const dataDir = `${outputDir}/data`;
|
|
509
|
+
const thumbnailsDir = `${outputDir}/thumbnails`;
|
|
676
510
|
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
}
|
|
686
|
-
console.log('Custom text components asset source registered');
|
|
687
|
-
```
|
|
511
|
+
if (!existsSync(outputDir)) {
|
|
512
|
+
mkdirSync(outputDir, { recursive: true });
|
|
513
|
+
}
|
|
514
|
+
if (!existsSync(dataDir)) {
|
|
515
|
+
mkdirSync(dataDir, { recursive: true });
|
|
516
|
+
}
|
|
517
|
+
if (!existsSync(thumbnailsDir)) {
|
|
518
|
+
mkdirSync(thumbnailsDir, { recursive: true });
|
|
519
|
+
}
|
|
688
520
|
|
|
689
|
-
|
|
521
|
+
// Save the archive as a zip file
|
|
522
|
+
// Extract this archive to get the blocks.blocks file and any resources (fonts, images)
|
|
523
|
+
// After extraction, the directory structure should be:
|
|
524
|
+
// data/customTitle/blocks.blocks
|
|
525
|
+
// data/customTitle/fonts/... (if any custom fonts)
|
|
526
|
+
// data/customTitle/images/... (if any images)
|
|
527
|
+
const archivePath = `${dataDir}/customTitle.zip`;
|
|
528
|
+
const archiveBuffer = Buffer.from(await archiveBlob.arrayBuffer());
|
|
529
|
+
writeFileSync(archivePath, archiveBuffer);
|
|
530
|
+
console.log(`Saved archive to: ${archivePath}`);
|
|
531
|
+
console.log(
|
|
532
|
+
'Extract this archive to create the data/customTitle/ directory'
|
|
533
|
+
);
|
|
690
534
|
|
|
691
|
-
|
|
535
|
+
// Save the thumbnail
|
|
536
|
+
const thumbnailPath = `${thumbnailsDir}/customTitle.png`;
|
|
537
|
+
const thumbnailBuffer = Buffer.from(await thumbnailBlob.arrayBuffer());
|
|
538
|
+
writeFileSync(thumbnailPath, thumbnailBuffer);
|
|
539
|
+
console.log(`Saved thumbnail to: ${thumbnailPath}`);
|
|
692
540
|
|
|
693
|
-
|
|
541
|
+
// Save the content.json
|
|
542
|
+
const contentJsonPath = `${outputDir}/content.json`;
|
|
543
|
+
writeFileSync(contentJsonPath, JSON.stringify(contentJson, null, 2));
|
|
544
|
+
console.log(`Saved content.json to: ${contentJsonPath}`);
|
|
545
|
+
```
|
|
694
546
|
|
|
695
|
-
|
|
696
|
-
// Configure the asset library to display the custom text components
|
|
697
|
-
// Add translation for the library entry label
|
|
698
|
-
cesdk.i18n.setTranslations({
|
|
699
|
-
en: { 'libraries.text-components-entry.label': 'Text Components' }
|
|
700
|
-
});
|
|
547
|
+
The output directory contains all files needed to host your custom text components. Extract each `.zip` archive to create the expected directory structure with `blocks.blocks` and any bundled resources.
|
|
701
548
|
|
|
702
|
-
|
|
703
|
-
cesdk.ui.addAssetLibraryEntry({
|
|
704
|
-
id: 'text-components-entry',
|
|
705
|
-
sourceIds: ['custom.textComponents'],
|
|
706
|
-
previewLength: 2,
|
|
707
|
-
previewBackgroundType: 'contain',
|
|
708
|
-
gridBackgroundType: 'contain',
|
|
709
|
-
gridColumns: 2,
|
|
710
|
-
cardLabelPosition: () => 'below'
|
|
711
|
-
});
|
|
549
|
+
## Registering the Asset Source
|
|
712
550
|
|
|
713
|
-
|
|
714
|
-
cesdk.ui.setComponentOrder({ in: 'ly.img.dock' }, [
|
|
715
|
-
...cesdk.ui.getComponentOrder({ in: 'ly.img.dock' }),
|
|
716
|
-
'ly.img.spacer',
|
|
717
|
-
{
|
|
718
|
-
id: 'ly.img.assetLibrary.dock',
|
|
719
|
-
key: 'text-components-dock',
|
|
720
|
-
label: 'Text Components',
|
|
721
|
-
icon: '@imgly/Type',
|
|
722
|
-
entries: ['text-components-entry']
|
|
723
|
-
}
|
|
724
|
-
]);
|
|
551
|
+
In production, host the extracted files and register the asset source from a URL using `addLocalAssetSourceFromJSON()`. The SDK will use `loadFromURL()` to load components from the URIs specified in content.json.
|
|
725
552
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
553
|
+
```typescript highlight=highlight-register-asset-source
|
|
554
|
+
// In production, host the files and register the asset source from a URL:
|
|
555
|
+
//
|
|
556
|
+
// await engine.asset.addLocalAssetSourceFromJSON(
|
|
557
|
+
// new URL('https://your-server.com/my.custom.textComponents/content.json')
|
|
558
|
+
// );
|
|
559
|
+
//
|
|
560
|
+
// The SDK will then use block.loadFromURL() to load components from
|
|
561
|
+
// the URIs specified in content.json (e.g., data/customTitle/blocks.blocks)
|
|
562
|
+
console.log('\nTo use these components in production:');
|
|
563
|
+
console.log('1. Extract the archives:');
|
|
564
|
+
console.log(' unzip data/customTitle.zip -d data/customTitle/');
|
|
565
|
+
console.log(' unzip data/promo.zip -d data/promo/');
|
|
566
|
+
console.log('2. Host the output directory on your server');
|
|
567
|
+
console.log(
|
|
568
|
+
'3. Register with: engine.asset.addLocalAssetSourceFromJSON(new URL(contentJsonUrl))'
|
|
569
|
+
);
|
|
730
570
|
```
|
|
731
571
|
|
|
732
|
-
The
|
|
572
|
+
The console output shows the steps needed for production deployment: extract archives, host the files, and register the asset source with the hosted content.json URL.
|
|
733
573
|
|
|
734
574
|
## Creating Additional Components
|
|
735
575
|
|
|
736
576
|
We create a second component with different styling to demonstrate building a library of text components.
|
|
737
577
|
|
|
738
578
|
```typescript highlight=highlight-create-second-component
|
|
739
|
-
const promoComponent = engine.block.create('text');
|
|
740
|
-
engine.block.appendChild(page, promoComponent);
|
|
741
|
-
|
|
742
|
-
engine.block.replaceText(promoComponent, 'SALE');
|
|
743
|
-
engine.block.setFloat(promoComponent, 'text/fontSize', 96);
|
|
744
|
-
|
|
745
|
-
// Use a bold red color for the promo text
|
|
746
|
-
engine.block.setTextColor(promoComponent, {
|
|
747
|
-
r: 0.9,
|
|
748
|
-
g: 0.2,
|
|
749
|
-
b: 0.2,
|
|
750
|
-
a: 1.0
|
|
751
|
-
});
|
|
579
|
+
const promoComponent = engine.block.create('text');
|
|
580
|
+
engine.block.appendChild(page, promoComponent);
|
|
752
581
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
name: 'Roboto',
|
|
756
|
-
fonts: [
|
|
757
|
-
{
|
|
758
|
-
uri: 'https://cdn.img.ly/assets/v3/ly.img.typeface/fonts/Roboto/Roboto-Bold.ttf',
|
|
759
|
-
subFamily: 'Bold'
|
|
760
|
-
}
|
|
761
|
-
]
|
|
762
|
-
};
|
|
763
|
-
engine.block.setFont(
|
|
764
|
-
promoComponent,
|
|
765
|
-
robotoTypeface.fonts[0].uri,
|
|
766
|
-
robotoTypeface
|
|
767
|
-
);
|
|
582
|
+
engine.block.replaceText(promoComponent, 'SALE');
|
|
583
|
+
engine.block.setFloat(promoComponent, 'text/fontSize', 96);
|
|
768
584
|
|
|
769
|
-
|
|
770
|
-
engine.block.
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
engine.block.setBool(promoComponent, 'backgroundColor/enabled', true);
|
|
777
|
-
engine.block.setColor(promoComponent, 'backgroundColor/color', {
|
|
778
|
-
r: 1.0,
|
|
779
|
-
g: 0.95,
|
|
780
|
-
b: 0.9,
|
|
781
|
-
a: 1.0
|
|
782
|
-
});
|
|
585
|
+
// Use a bold red color for the promo text
|
|
586
|
+
engine.block.setTextColor(promoComponent, {
|
|
587
|
+
r: 0.9,
|
|
588
|
+
g: 0.2,
|
|
589
|
+
b: 0.2,
|
|
590
|
+
a: 1.0
|
|
591
|
+
});
|
|
783
592
|
|
|
784
|
-
|
|
785
|
-
|
|
593
|
+
// Set a bold font for the promo component
|
|
594
|
+
const robotoTypeface = {
|
|
595
|
+
name: 'Roboto',
|
|
596
|
+
fonts: [
|
|
597
|
+
{
|
|
598
|
+
uri: 'https://cdn.img.ly/assets/v3/ly.img.typeface/fonts/Roboto/Roboto-Bold.ttf',
|
|
599
|
+
subFamily: 'Bold'
|
|
600
|
+
}
|
|
601
|
+
]
|
|
602
|
+
};
|
|
603
|
+
engine.block.setFont(
|
|
604
|
+
promoComponent,
|
|
605
|
+
robotoTypeface.fonts[0].uri,
|
|
606
|
+
robotoTypeface
|
|
607
|
+
);
|
|
608
|
+
|
|
609
|
+
engine.block.setWidthMode(promoComponent, 'Absolute');
|
|
610
|
+
engine.block.setHeightMode(promoComponent, 'Absolute');
|
|
611
|
+
engine.block.setWidth(promoComponent, 300);
|
|
612
|
+
engine.block.setHeight(promoComponent, 120);
|
|
613
|
+
engine.block.setBool(promoComponent, 'clipped', true);
|
|
614
|
+
|
|
615
|
+
engine.block.setPositionX(promoComponent, 50);
|
|
616
|
+
engine.block.setPositionY(promoComponent, 200);
|
|
617
|
+
|
|
618
|
+
// Save the promo component as an archive
|
|
619
|
+
const promoArchiveBlob = await engine.block.saveToArchive([promoComponent]);
|
|
620
|
+
const promoArchiveBuffer = Buffer.from(
|
|
621
|
+
await promoArchiveBlob.arrayBuffer()
|
|
622
|
+
);
|
|
623
|
+
writeFileSync(`${dataDir}/promo.zip`, promoArchiveBuffer);
|
|
624
|
+
console.log(`Saved promo archive to: ${dataDir}/promo.zip`);
|
|
625
|
+
|
|
626
|
+
// Export promo thumbnail
|
|
627
|
+
const promoThumbnail = await engine.block.export(promoComponent, {
|
|
628
|
+
mimeType: 'image/png',
|
|
629
|
+
targetWidth: 400,
|
|
630
|
+
targetHeight: 320
|
|
631
|
+
});
|
|
632
|
+
const promoThumbnailBuffer = Buffer.from(
|
|
633
|
+
await promoThumbnail.arrayBuffer()
|
|
634
|
+
);
|
|
635
|
+
writeFileSync(`${thumbnailsDir}/promo.png`, promoThumbnailBuffer);
|
|
636
|
+
console.log(`Saved promo thumbnail to: ${thumbnailsDir}/promo.png`);
|
|
786
637
|
```
|
|
787
638
|
|
|
788
639
|
Each component can have unique styling, dimensions, and behavior. Build a library by creating multiple components and adding them to your content.json.
|
|
789
640
|
|
|
641
|
+
## Cleaning Up
|
|
642
|
+
|
|
643
|
+
We dispose of the engine to free system resources. Always clean up the engine when finished with processing.
|
|
644
|
+
|
|
645
|
+
```typescript highlight=highlight-cleanup
|
|
646
|
+
// Always dispose of the engine to free resources
|
|
647
|
+
engine.dispose();
|
|
648
|
+
```
|
|
649
|
+
|
|
790
650
|
## Troubleshooting
|
|
791
651
|
|
|
792
|
-
**Archive fails
|
|
652
|
+
**Archive creation fails**: Ensure the block has valid dimensions and is part of the scene hierarchy before calling `saveToArchive()`.
|
|
793
653
|
|
|
794
|
-
**
|
|
654
|
+
**Engine initialization fails**: Verify Node.js version compatibility and ensure `@cesdk/node` is properly installed.
|
|
795
655
|
|
|
796
|
-
**
|
|
656
|
+
**Thumbnail export fails**: Ensure the block has valid dimensions and is part of the scene hierarchy.
|
|
797
657
|
|
|
798
|
-
**
|
|
658
|
+
**File write errors**: Verify the output directory exists or use `mkdirSync` with `recursive: true`.
|
|
799
659
|
|
|
800
|
-
**
|
|
660
|
+
**Resources missing after extraction**: Ensure you extract the complete archive including all subdirectories (fonts/, images/).
|
|
661
|
+
|
|
662
|
+
**Memory issues with batch processing**: Dispose of the engine between batches or use a single engine instance with scene cleanup.
|
|
801
663
|
|
|
802
664
|
## API Reference
|
|
803
665
|
|
|
804
|
-
| Method
|
|
805
|
-
|
|
806
|
-
| `
|
|
807
|
-
| `engine.
|
|
808
|
-
| `engine.block.
|
|
809
|
-
| `engine.block.
|
|
810
|
-
| `engine.block.
|
|
811
|
-
| `engine.block.
|
|
812
|
-
| `engine.block.
|
|
813
|
-
| `engine.block.
|
|
814
|
-
| `engine.block.
|
|
815
|
-
| `engine.block.
|
|
816
|
-
| `engine.block.
|
|
817
|
-
| `engine.block.
|
|
818
|
-
| `engine.block.
|
|
819
|
-
| `engine.block.
|
|
820
|
-
| `engine.
|
|
821
|
-
| `engine.asset.
|
|
822
|
-
| `
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
| `cesdk.i18n.setTranslations()` | Add translations for UI labels |
|
|
666
|
+
| Method | Purpose |
|
|
667
|
+
|--------|---------|
|
|
668
|
+
| `CreativeEngine.init()` | Initialize the headless engine |
|
|
669
|
+
| `engine.scene.create()` | Create a new scene with options |
|
|
670
|
+
| `engine.block.create()` | Create a new block of specified type |
|
|
671
|
+
| `engine.block.replaceText()` | Set text content on a text block |
|
|
672
|
+
| `engine.block.setFloat()` | Set numeric properties like font size |
|
|
673
|
+
| `engine.block.setFont()` | Set font with typeface definition and URI |
|
|
674
|
+
| `engine.block.setTextColor()` | Set text color with RGBA values |
|
|
675
|
+
| `engine.block.setWidthMode()` | Set width mode: 'Absolute', 'Percent', 'Auto' |
|
|
676
|
+
| `engine.block.setHeightMode()` | Set height mode: 'Absolute', 'Percent', 'Auto' |
|
|
677
|
+
| `engine.block.setBool()` | Enable/disable boolean properties |
|
|
678
|
+
| `engine.block.setColor()` | Set color properties like background |
|
|
679
|
+
| `engine.block.saveToArchive()` | Save blocks to zip archive with all resources |
|
|
680
|
+
| `engine.block.saveToString()` | Legacy: Save blocks as string (requires external resources) |
|
|
681
|
+
| `engine.block.loadFromString()` | Legacy: Load blocks from string |
|
|
682
|
+
| `engine.block.export()` | Export block as image blob |
|
|
683
|
+
| `engine.asset.addLocalAssetSourceFromJSON()` | Register custom asset source from URL |
|
|
684
|
+
| `engine.dispose()` | Clean up engine resources |
|
|
685
|
+
|
|
686
|
+
|
|
826
687
|
|
|
827
688
|
---
|
|
828
689
|
|
|
829
690
|
## More Resources
|
|
830
691
|
|
|
831
|
-
- **[
|
|
692
|
+
- **[Node.js Documentation Index](https://img.ly/docs/cesdk/node.md)** - Browse all Node.js documentation
|
|
832
693
|
- **[Complete Documentation](./llms-full.txt.md)** - Full documentation in one file (for LLMs)
|
|
833
|
-
- **[Web Documentation](./
|
|
834
|
-
- **[Support](mailto:support@img.ly)** - Contact IMG.LY support
|
|
694
|
+
- **[Web Documentation](./node.md)** - Interactive documentation with examples
|
|
695
|
+
- **[Support](mailto:support@img.ly)** - Contact IMG.LY support
|