Files
vectorcraft/crates/engine/src/cmd/plugin_call/reviewed.rs
T
dotCooCoo 8b2ff77429 Plug-ins: a plug-in may call effect.deferredStatus but not effect.refreshDeferred
effect.deferredStatus only lists the document's deferred stages, so it joins reviewed::ALLOWED. effect.refreshDeferred runs plug-in effects again, so it joins reviewed::DENIED, which fixes every_command_is_reviewed.
2026-11-11 02:27:30 -08:00

679 lines
18 KiB
Rust

//! The commands no rule in [`super::denied`] refuses, each placed in one list: those a plug-in may
//! call ([`ALLOWED`]) and those it may not ([`DENIED`]). A command in neither is refused, and the
//! test `every_command_is_reviewed` fails until it is placed.
/// Commands a plug-in may call when its manifest lists them, in order.
pub(super) const ALLOWED: &[&str] = &[
"addon.arrange.grid",
"addon.arrange.groupOverlapping",
"addon.arrange.randomizeOpacity",
"addon.arrange.replace",
"addon.arrange.size",
"addon.arrange.sort",
"addon.arrange.swap",
"addon.cleanup.alignInPlace",
"addon.cleanup.breakText",
"addon.cleanup.check",
"addon.cleanup.combineText",
"addon.cleanup.deepUngroup",
"addon.cleanup.fix",
"addon.cleanup.joinText",
"addon.cleanup.rejoin",
"addon.cleanup.removeBreaks",
"addon.cleanup.replaceFonts",
"addon.cleanup.resetTextTransform",
"addon.cleanup.show",
"addon.cleanup.simplify",
"addon.color.applyNearestSwatch",
"addon.color.fillToStroke",
"addon.color.filter",
"addon.color.nearestSwatch",
"addon.color.select",
"addon.color.strokeToFill",
"addon.color.swatchLegend",
"addon.contour.set",
"addon.pathtools.addPoints",
"addon.pathtools.close",
"addon.pathtools.corner",
"addon.pathtools.cornerRemove",
"addon.pathtools.cornerSet",
"addon.pathtools.crossings",
"addon.pathtools.divideDashes",
"addon.pathtools.equalize",
"addon.pathtools.erase",
"addon.pathtools.expandDashes",
"addon.pathtools.extend",
"addon.pathtools.inspect",
"addon.pathtools.mergeEdge",
"addon.pathtools.removeKeepShape",
"addon.pathtools.setAnchor",
"addon.pathtools.shape.convert",
"addon.pathtools.shape.create",
"addon.pathtools.shape.set",
"addon.pathtools.slideAnchor",
"addon.pathtools.smooth",
"addon.pen.append",
"addon.pen.close",
"addon.pen.closeJoin",
"addon.pen.removePoint",
"addon.pen.reshape",
"addon.pen.segment",
"addon.pen.togglePoint",
"addon.select.byArtboards",
"addon.shapes.box3d",
"addon.shapes.configure",
"addon.shapes.ellipse",
"addon.shapes.polygon",
"addon.shapes.rectangle",
"addon.shapes.spiral",
"addon.shapes.star",
"addon.type.releasePath",
"addon.type.textTweaker",
"appearance.addEffect",
"appearance.addFill",
"appearance.addStroke",
"appearance.clear",
"appearance.copyFrom",
"appearance.duplicateItem",
"appearance.moveItem",
"appearance.reduceToBasic",
"appearance.removeItem",
"appearance.setActiveItem",
"appearance.setItem",
"appearance.showAllHidden",
"appearance.targetContents",
"appearance.transfer",
"artboard.convertToArtboards",
"artboard.delete",
"artboard.deleteEmpty",
"artboard.duplicate",
"artboard.fitToArt",
"artboard.fitToSelection",
"artboard.move",
"artboard.new",
"artboard.rearrange",
"artboard.rename",
"artboard.reorder",
"artboard.setProps",
"artboard.switchOrientation",
"attributes.info",
"attributes.set",
"brush.apply",
"brush.delete",
"brush.duplicate",
"brush.freehand",
"brush.get",
"brush.list",
"brush.move",
"brush.new",
"brush.options",
"brush.remove",
"brush.selectionArt",
"brush.setCurrent",
"brush.unused",
"charStyle.apply",
"charStyle.delete",
"charStyle.duplicate",
"charStyle.edit",
"charStyle.list",
"charStyle.new",
"charStyle.redefine",
"charStyle.rename",
"charStyle.setAttrs",
"charStyle.unused",
"color.convert",
"color.gamutCheck",
"color.harmony",
"color.plates",
"dataset.capture",
"dataset.delete",
"dataset.list",
"dataset.new",
"dataset.next",
"dataset.prev",
"dataset.rename",
"dataset.select",
"dataset.set",
"dataset.update",
"dimension.applyToAll",
"dimension.create",
"dimension.update",
"edit.clear",
"edit.colors.adjustBalance",
"edit.colors.blendFrontToBack",
"edit.colors.blendHorizontally",
"edit.colors.blendVertically",
"edit.colors.invert",
"edit.colors.saturate",
"edit.colors.toCMYK",
"edit.colors.toGrayscale",
"edit.colors.toRGB",
"edit.duplicate",
"edit.findNext",
"edit.findReplace",
"effect.apply",
"effect.deferredStatus",
"effect.duplicate",
"effect.expandAppearance",
"effect.list",
"effect.move",
"effect.remove",
"effect.setParams",
"flattener.preview",
"gradient.selectStop",
"graph.column",
"graph.create",
"graph.design",
"graph.marker",
"graph.setData",
"graph.setType",
"graphicStyle.apply",
"graphicStyle.delete",
"graphicStyle.duplicate",
"graphicStyle.list",
"graphicStyle.merge",
"graphicStyle.move",
"graphicStyle.new",
"graphicStyle.redefine",
"graphicStyle.rename",
"graphicStyle.sortByName",
"graphicStyle.unused",
"guide.add",
"guide.list",
"guide.move",
"guide.remove",
"guide.select",
"guide.setLayer",
"image.info",
"imageTrace.expand",
"imageTrace.make",
"imageTrace.makeAndExpand",
"imageTrace.release",
"imageTrace.setView",
"layer.clippingMask.toggle",
"layer.collectInNew",
"layer.delete",
"layer.duplicate",
"layer.flatten",
"layer.hideOthers",
"layer.highlight",
"layer.locate",
"layer.lockOthers",
"layer.merge",
"layer.move",
"layer.new",
"layer.newSublayer",
"layer.outlineOthers",
"layer.previewAll",
"layer.releaseToLayers",
"layer.releaseToLayersBuild",
"layer.reverse",
"layer.selectAll",
"layer.setCurrent",
"layer.setProps",
"layer.showAll",
"layer.target",
"layer.template",
"layer.unlockAll",
"livePaint.expand",
"livePaint.fill",
"livePaint.gapOptions",
"livePaint.info",
"livePaint.make",
"livePaint.merge",
"livePaint.release",
"livePaint.strokeEdge",
"node.move",
"object.align",
"object.arrange.bringForward",
"object.arrange.bringToFront",
"object.arrange.sendBackward",
"object.arrange.sendToBack",
"object.arrange.sendToCurrentLayer",
"object.blend.expand",
"object.blend.info",
"object.blend.make",
"object.blend.release",
"object.blend.replaceSpine",
"object.blend.reverseFrontToBack",
"object.blend.reverseSpine",
"object.blend.spine.addAnchor",
"object.blend.spine.convertAnchor",
"object.blend.spine.moveAnchor",
"object.blend.spine.removeAnchor",
"object.blend.spine.reshapeSegment",
"object.clippingMask.editContents",
"object.clippingMask.editMask",
"object.clippingMask.make",
"object.clippingMask.release",
"object.compoundPath.make",
"object.compoundPath.release",
"object.compoundShape.expand",
"object.compoundShape.make",
"object.compoundShape.release",
"object.compoundShape.setMode",
"object.convertDocumentColorMode",
"object.createObjectMosaic",
"object.createTrimMarks",
"object.cropImage",
"object.distort",
"object.distribute",
"object.distributeSpacing",
"object.envelope.editContents",
"object.envelope.expand",
"object.envelope.info",
"object.envelope.makeWithMesh",
"object.envelope.makeWithTopObject",
"object.envelope.makeWithWarp",
"object.envelope.options",
"object.envelope.release",
"object.envelope.resetWithMesh",
"object.envelope.resetWithWarp",
"object.envelope.setMeshPoint",
"object.exitIsolation",
"object.expand",
"object.expand.info",
"object.expandBrush",
"object.expandShape",
"object.flattenTransparency",
"object.group",
"object.hide",
"object.hide.above",
"object.hide.otherLayers",
"object.hide.unselected",
"object.intertwine.arrange",
"object.intertwine.edit",
"object.intertwine.make",
"object.intertwine.release",
"object.isolate",
"object.lock",
"object.lock.above",
"object.lock.otherLayers",
"object.lock.unselected",
"object.makePixelPerfect",
"object.maskImage",
"object.mesh.addLine",
"object.mesh.create",
"object.mesh.deletePoint",
"object.mesh.expand",
"object.mesh.movePoint",
"object.mesh.movePoints",
"object.mesh.setPointColor",
"object.move",
"object.nudge",
"object.objectsOnPath.attach",
"object.objectsOnPath.expand",
"object.objectsOnPath.options",
"object.path.addAnchorPoints",
"object.path.cleanUp",
"object.path.divideObjectsBelow",
"object.path.offsetPath",
"object.path.outlineStroke",
"object.path.simplify",
"object.path.smooth",
"object.path.splitIntoGrid",
"object.pathfinder.crop",
"object.pathfinder.divide",
"object.pathfinder.exclude",
"object.pathfinder.intersect",
"object.pathfinder.merge",
"object.pathfinder.minusBack",
"object.pathfinder.minusFront",
"object.pathfinder.outline",
"object.pathfinder.trap",
"object.pathfinder.trim",
"object.pathfinder.unite",
"object.pattern.cancel",
"object.pattern.done",
"object.pattern.edit",
"object.pattern.make",
"object.puppetWarp",
"object.puppetWarp.pins",
"object.rasterize",
"object.reflect",
"object.repeat.expand",
"object.repeat.grid",
"object.repeat.mirror",
"object.repeat.options",
"object.repeat.radial",
"object.repeat.release",
"object.resetBoundingBox",
"object.rotate",
"object.scale",
"object.setBounds",
"object.setLiveShape",
"object.setPixelAligned",
"object.setProps",
"object.shape.convertToShape",
"object.shear",
"object.showAll",
"object.slice.clipToArtboard",
"object.slice.combine",
"object.slice.create",
"object.slice.delete",
"object.slice.deleteAll",
"object.slice.divide",
"object.slice.duplicate",
"object.slice.fromGuides",
"object.slice.fromSelection",
"object.slice.make",
"object.slice.move",
"object.slice.options",
"object.slice.release",
"object.slice.select",
"object.slice.setRect",
"object.textWrap.make",
"object.textWrap.options",
"object.textWrap.release",
"object.transform",
"object.transformAgain",
"object.transformEach",
"object.ungroup",
"object.unlockAll",
"object.vectorHalftone",
"paint.complement",
"paint.default",
"paint.editGradient",
"paint.freeform.addLine",
"paint.freeform.addPoint",
"paint.freeform.deletePoint",
"paint.freeform.get",
"paint.freeform.selectPoint",
"paint.freeform.setPoint",
"paint.freeform.splitLine",
"paint.invert",
"paint.lastColor",
"paint.lastGradient",
"paint.none",
"paint.proxies",
"paint.recent",
"paint.sampleColor",
"paint.setFill",
"paint.setGradientGeom",
"paint.setStroke",
"paint.swap",
"paint.toggleActive",
"paraStyle.apply",
"paraStyle.delete",
"paraStyle.duplicate",
"paraStyle.list",
"paraStyle.new",
"paraStyle.redefine",
"paraStyle.rename",
"paraStyle.setAttrs",
"paraStyle.unused",
"path.appendAnchor",
"path.average",
"path.averageJoin",
"path.blob",
"path.close",
"path.convertAnchor",
"path.convertAnchors",
"path.create",
"path.curvature",
"path.curvatureEdit",
"path.cutAtAnchors",
"path.deleteAnchors",
"path.eraseRegion",
"path.eraseSegments",
"path.freehand",
"path.insertAnchor",
"path.join",
"path.joinScrub",
"path.knife",
"path.lineCut",
"path.mirrorCut",
"path.moveAnchor",
"path.moveAnchors",
"path.rectCut",
"path.removeAnchor",
"path.removeAnchors",
"path.reshape",
"path.reshapeSegment",
"path.reverse",
"path.setAnchors",
"path.setFillRule",
"path.setHandle",
"path.smoothRegion",
"path.split",
"pattern.delete",
"pattern.list",
"pattern.options",
"pattern.transform",
"perspective.attach",
"perspective.draw",
"perspective.editText",
"perspective.grid.define",
"perspective.grid.get",
"perspective.grid.lock",
"perspective.grid.lockStation",
"perspective.grid.rulers",
"perspective.grid.set",
"perspective.grid.show",
"perspective.grid.snap",
"perspective.move",
"perspective.nudge",
"perspective.plane.matchObject",
"perspective.plane.move",
"perspective.plane.set",
"perspective.release",
"perspective.transform",
"recolor.apply",
"recolor.colors",
"recolor.randomize",
"recolor.reduce",
"select.add",
"select.all",
"select.allOnArtboard",
"select.anchors",
"select.anchorsMany",
"select.color",
"select.font",
"select.globalEdit",
"select.globalEditExclude",
"select.globalEditOptions",
"select.inverse",
"select.key",
"select.magicWand",
"select.nextAbove",
"select.nextBelow",
"select.none",
"select.object.allOnSameLayers",
"select.object.areaText",
"select.object.bristleBrushStrokes",
"select.object.brushStrokes",
"select.object.clippingMasks",
"select.object.directionHandles",
"select.object.pointText",
"select.object.slices",
"select.object.strayPoints",
"select.object.textObjects",
"select.recall",
"select.reselect",
"select.same.appearance",
"select.same.appearanceAttribute",
"select.same.blendingMode",
"select.same.fillAndStroke",
"select.same.fillColor",
"select.same.fontFamily",
"select.same.fontFamilyStyle",
"select.same.fontFamilyStyleSize",
"select.same.fontSize",
"select.same.graphicStyle",
"select.same.opacity",
"select.same.shapeType",
"select.same.strokeColor",
"select.same.strokeWeight",
"select.same.symbolInstance",
"select.same.textFillAndStrokeColor",
"select.same.textFillColor",
"select.same.textStrokeColor",
"select.segments",
"select.set",
"select.toggle",
"select.update",
"shape.arc",
"shape.ellipse",
"shape.flare",
"shape.line",
"shape.polarGrid",
"shape.polygon",
"shape.rectangle",
"shape.rectangularGrid",
"shape.spiral",
"shape.star",
"shapeBuilder.merge",
"shapeBuilder.regions",
"shaper.expand",
"shaper.release",
"shaper.releaseSource",
"shaper.scribble",
"shaper.select",
"slice.list",
"stroke.set",
"stroke.setAdvanced",
"stroke.weightDown",
"stroke.weightUp",
"stroke.widthPoint.copy",
"stroke.widthPoint.remove",
"stroke.widthPoint.set",
"svgFilter.apply",
"svgFilter.define",
"svgFilter.delete",
"svgFilter.list",
"svgInteractivity.clearEvents",
"svgInteractivity.info",
"svgInteractivity.removeEvent",
"svgInteractivity.setEvent",
"swatch.addUsedColors",
"swatch.delete",
"swatch.duplicate",
"swatch.edit",
"swatch.editGroup",
"swatch.list",
"swatch.merge",
"swatch.move",
"swatch.new",
"swatch.newGroup",
"swatch.resetDefaults",
"swatch.setSpot",
"swatch.sortByKind",
"swatch.sortByName",
"swatch.spotOptions",
"swatch.ungroup",
"swatch.unused",
"symbol.adjust",
"symbol.delete",
"symbol.duplicate",
"symbol.edit",
"symbol.exitEditing",
"symbol.instance.reset",
"symbol.instance.resetTransform",
"symbol.instance.selectPart",
"symbol.instance.setAppearance",
"symbol.list",
"symbol.new",
"symbol.options",
"symbol.place",
"symbol.replace",
"symbol.selectInstances",
"symbol.setCurrent",
"symbol.spray",
"symbol.unused",
"symbol.update",
"text.areaOptions",
"text.convertListToText",
"text.create",
"text.createInPath",
"text.discardEmpty",
"text.editRange",
"text.fitHeadline",
"text.fonts",
"text.getRange",
"text.glyphAlternates",
"text.insertInline",
"text.missingFonts",
"text.replaceFont",
"text.reshapeArea",
"text.reshapePath",
"text.setFormat",
"text.setGlyphAlternate",
"text.setPathHandle",
"text.setRangeStyle",
"text.setStyle",
"text.setText",
"text.startList",
"text.tabs.clear",
"text.tabs.get",
"text.tabs.set",
"text.thread.add",
"text.thread.break",
"text.thread.create",
"text.thread.info",
"text.thread.releaseSelection",
"text.thread.remove",
"text.touchType",
"transparency.disableOpacityMask",
"transparency.editOpacityMask",
"transparency.enableOpacityMask",
"transparency.info",
"transparency.makeOpacityMask",
"transparency.opacityMaskInfo",
"transparency.releaseOpacityMask",
"transparency.set",
"transparency.setOpacityMask",
"transparency.stopEditingOpacityMask",
"transparency.togglePageIsolatedBlending",
"transparency.togglePageKnockoutGroup",
"transparency.viewOpacityMask",
"type.changeCase",
"type.compositeFonts.list",
"type.convertToAreaType",
"type.convertToPointType",
"type.createOutlines",
"type.fillPlaceholder",
"type.fitHeadline",
"type.insert",
"type.opticalMarginAlignment",
"type.orientation.horizontal",
"type.orientation.vertical",
"type.pathOptions",
"type.resetHorizontalScale",
"type.resetTracking",
"type.ruby",
"type.scaleTextAttributes",
"type.size.decrease",
"type.size.decreaseByFive",
"type.size.increase",
"type.size.increaseByFive",
"type.smartPunctuation",
"type.step",
"variable.bind",
"variable.define",
"variable.delete",
"variable.highlight",
"variable.list",
"variable.lock",
"variable.makeGraphDynamic",
"variable.makeImageDynamic",
"variable.makeTextDynamic",
"variable.makeVisibilityDynamic",
"variable.rename",
"variable.unbind",
];
/// Commands a plug-in may not call although no rule refuses them, in order: they change the
/// preferences, a tool's options, a drag's state or the font names the whole app knows, or run
/// plug-ins again.
pub(super) const DENIED: &[&str] = &[
"addon.cleanup.splitText",
"addon.pathtools.movePointsTogether",
"addon.pen.nextSegment",
"effect.refreshDeferred",
"graphicStyle.setOptions",
"object.blend.options",
"object.liquify",
"object.pathfinder.options",
"type.compositeFonts.set",
];