@nextgensoftwares/folio-layers-core
The DOM- and React-free core of Folio's layered pages (0.5+): the drawing model, sanitizing, ECMA-376 DrawingML geometry (preset shapes, connection sites, WordArt warps, the guide interpreter), drawing layout (text in shapes, wrapping, threads, page backgrounds and borders) and the PDF and canvas painters. It depends only on folio-layout and folio-model, so servers, workers, exporters and slides install no React, editor or ProseMirror.
| Entry | What |
|---|---|
@nextgensoftwares/folio-layers-core | everything below |
@nextgensoftwares/folio-layers-core/internal | every module's exports, for Folio's own packages (folio-plugin-layers builds on them); not a stable API |
@nextgensoftwares/folio-plugin-layers/core re-exports this package unchanged, and @nextgensoftwares/folio-plugin-layers re-exports it with the editor plugin and its React UI. Each export is described on the plugin-layers page; by module:
| Module | Exports |
|---|---|
Schema (schema) | DRAWING, WRAPS, drawingSpec, layersSchema, isDrawingObject, isLayersSettings |
Model (model/types) | PRESETS, ObjectBase, Preset, Geometry, GradientStop, Fill, ArrowEnd, Dash, Stroke, Shadow, TextBody, ShapeObject, ImageObject, ImageAdjust, adjustFilter, GroupObject, DrawingObject, LayerWrap |
Model (model/color) | parseColor, normalizeColor, isColor, docxHex, alphaOf, Rgba |
Model (model/limits) | LIMITS |
Model (model/sanitize) | sanitizeObject, readObject, sanitizeFill, sanitizeStroke, sanitizeShadow, sanitizeText, sanitizeGeometry, isSafeSrc, newId; (model/effects) sanitizeGlow, sanitizeReflection; (model/effect-types) Glow, Reflection |
Model (model/content) | sanitizeContent, contentText, paragraphOf |
Model (model/settings) | LAYERS_ATTR, sanitizeSettings, readSettings, LayersSettings, SectionLayers, PageBackground, PageBorder, PlacedObject, PlacedWrap, PageObject |
Model (model/tree) | walk, findObject, pathTo, updateObject, idsOf, countObjects, jsonEqual |
Geometry (geometry/path) | parsePath, toSvgPath, toPdfPath, scalePath, isPathData, isOpenPath, PATH_LIMITS, PathCmd |
Geometry (geometry/presets) | geometryPath, geometryParts, ellipsePath, roundRectPath |
Geometry (geometry/dml) | loadPresetShapes, presetShapesLoaded, onPresetShapesLoaded, isPresetShape, presetShapeParts, presetShapeTextRect, presetShapeHandles, presetShapeDefaults, dragShapeHandle, presetShapeDef, sanitizeDml (a known preset name and finite adjust values from untrusted input), ShapeHandle, GeometryPart, PartFill, ShapeDef |
Geometry (geometry/connection-sites) | presetConnectionSites, ConnectionSite |
Geometry (geometry/arrows) | arrowHeads, dashArray |
Geometry (geometry/warp) | warpMapper, isWarp, sanitizeWarp, loadTextWarps, textWarpsLoaded, onTextWarpsLoaded, TextWarp |
Vertical text (layout/vertical) | loadVerticalText, verticalTextLoaded, onVerticalTextLoaded (the upright-glyph layout's lazy chunk) |
Geometry (geometry/guides) | guideBuiltins, guideFormula, evaluateGuides, guidePathPoints |
Layout (layout/text-warp) | warpText, WarpedText, Outliner, OutlineCmd |
Geometry (geometry/transform) | boxMatrix, boundsOf, rotatedBounds, multiply, invert, applyMatrix, cssMatrix, IDENTITY, Matrix |
Layout (layout/renderer) | drawingRenderer, viewFor, drawingFragment, outlineOf, DRAWING_FRAGMENT, DrawingFragmentAttrs, DrawingSource |
Layout (layout/view) | buildView, objectBoxes, DrawingView, ObjectView |
Layout (layout/text) | layoutText, measureText, splitFlow, DEFAULT_PAD, TextView |
Layout (layout/page-layer) | pageLayerFragments, attachPageLayers, pageLayersInput, pageObjectsOf, BACKGROUND_FRAGMENT, BORDER_FRAGMENT, PageLayersInput |
Layout (layout/page-objects) | layersPageObjects, layersRenderer, objectsOnPage, placedFragment |
Layout (layout/threads-doc) | threadDocument |
Painting (export/plan) | paintPlan, fragmentMatrix, imageBox, gradientAt, PaintStep; turned text (TextView.turn): turnMatrix(deg, w, h) (the box's matrix for painters), turnCss(deg, w, h) (the same as a CSS transform) |
Painting (export/pdf) | drawingPdf, backgroundPdf, borderPdf, layersPdfPainters, LayersPdfContext |
Painting (export/canvas) | drawingCanvas, backgroundCanvas, borderCanvas, layersCanvasPainters, LayersCanvasContext |
Pictures (media/batch, media/resolve-src, media/collect-srcs) | createSrcResolver (stored srcs → URLs: batched per frame, cached, misses remembered, backoff on 503/429), isLoadable, MediaResolver, SrcResolver, SrcBatchResolver; readerMediaResolver(resolveSrc, resolveSrcs, label?), withResolvedSrc(painters, resolver) (canvas/PDF painters whose pictures resolve first, a page's in one batch), collectSrcs(x, out) (picture srcs anywhere in attrs); shared by the layers and slides reader plugins |