Update tag names

This commit is contained in:
Steve Ruiz 2021-06-19 18:22:46 +01:00
parent 76008bb8cd
commit 6729435696
20 changed files with 32 additions and 46 deletions

View file

@ -11,7 +11,7 @@ export default function createPage(data: Data, goToPage = true) {
history.execute(
data,
new Command({
name: 'change_page',
name: 'create_page',
category: 'canvas',
do(data) {
const { page, pageState, currentPageId } = snapshot

View file

@ -2,18 +2,16 @@ import Command from './command'
import history from '../history'
import { Data } from 'types'
import { current } from 'immer'
import { getPage, getSelectedShapes } from 'utils/utils'
import { getShapeUtils } from 'lib/shape-utils'
import vec from 'utils/vec'
import storage from 'state/storage'
export default function changePage(data: Data, pageId: string) {
export default function deletePage(data: Data, pageId: string) {
const snapshot = getSnapshot(data, pageId)
history.execute(
data,
new Command({
name: 'change_page',
name: 'delete_page',
category: 'canvas',
do(data) {
data.currentPageId = snapshot.nextPageId

View file

@ -37,7 +37,7 @@ export default function deleteSelected(data: Data) {
history.execute(
data,
new Command({
name: 'delete_shapes',
name: 'delete_selection',
category: 'canvas',
manualSelection: true,
do(data) {

View file

@ -34,7 +34,7 @@ export default function distributeCommand(data: Data, type: DistributeType) {
history.execute(
data,
new Command({
name: 'distributed',
name: 'distribute_shapes',
category: 'canvas',
do(data) {
const { shapes } = getPage(data, currentPageId)

View file

@ -19,6 +19,7 @@ export default function duplicateCommand(data: Data) {
...shape,
id: uniqueId(),
point: vec.add(shape.point, vec.div([16, 16], getCurrentCamera(data).zoom)),
isGenerated: false,
}))
history.execute(

View file

@ -1,11 +1,11 @@
import Command from './command'
import history from '../history'
import { Data } from 'types'
import { getPage, getShape } from 'utils/utils'
import { getPage } from 'utils/utils'
import { EditSnapshot } from 'state/sessions/edit-session'
import { getShapeUtils } from 'lib/shape-utils'
export default function handleCommand(
export default function editCommand(
data: Data,
before: EditSnapshot,
after: EditSnapshot
@ -13,7 +13,7 @@ export default function handleCommand(
history.execute(
data,
new Command({
name: 'edited_shape',
name: 'edit_shape',
category: 'canvas',
do(data) {
const { initialShape, currentPageId } = after

View file

@ -33,7 +33,7 @@ export default function generateCommand(
history.execute(
data,
new Command({
name: 'translate_shapes',
name: 'generate_shapes',
category: 'canvas',
do(data) {
const { shapes } = getPage(data)

View file

@ -11,8 +11,6 @@ import {
} from 'utils/utils'
import { current } from 'immer'
import { createShape, getShapeUtils } from 'lib/shape-utils'
import { PropsOfType } from 'types'
import { uniqueId } from 'utils/utils'
import commands from '.'
export default function groupCommand(data: Data) {

View file

@ -15,7 +15,7 @@ import { getShapeUtils } from 'lib/shape-utils'
import vec from 'utils/vec'
import storage from 'state/storage'
export default function nudgeCommand(data: Data, newPageId: string) {
export default function moveToPageCommand(data: Data, newPageId: string) {
const { currentPageId: oldPageId } = data
const oldPage = getPage(data)
const selectedIds = setToArray(getSelectedIds(data))
@ -35,7 +35,7 @@ export default function nudgeCommand(data: Data, newPageId: string) {
history.execute(
data,
new Command({
name: 'set_direction',
name: 'move_to_page',
category: 'canvas',
manualSelection: true,
do(data) {

View file

@ -24,7 +24,7 @@ export default function moveCommand(data: Data, type: MoveType) {
history.execute(
data,
new Command({
name: 'move_shapes',
name: 'change_child_index',
category: 'canvas',
manualSelection: true,
do(data) {

View file

@ -17,7 +17,7 @@ export default function nudgeCommand(data: Data, delta: number[]) {
history.execute(
data,
new Command({
name: 'set_direction',
name: 'nudge_shapes',
category: 'canvas',
do(data) {
const { shapes } = getPage(data, currentPageId)

View file

@ -44,7 +44,7 @@ export default function pasteCommand(data: Data, initialShapes: Shape[]) {
history.execute(
data,
new Command({
name: 'pasting_new_shapes',
name: 'paste_new_shapes',
category: 'canvas',
manualSelection: true,
do(data) {

View file

@ -60,7 +60,7 @@ export default function rotateCcwCommand(data: Data) {
history.execute(
data,
new Command({
name: 'translate_shapes',
name: 'rotate_ccw',
category: 'canvas',
do(data) {
const { shapes } = getPage(data, currentPageId)

View file

@ -13,7 +13,7 @@ export default function rotateCommand(
history.execute(
data,
new Command({
name: 'translate_shapes',
name: 'rotate_shapes',
category: 'canvas',
do(data) {
const { shapes } = getPage(data)

View file

@ -1,9 +1,9 @@
import Command from "./command"
import history from "../history"
import { StretchType, Data, Edge, Corner } from "types"
import { getCommonBounds, getPage, getSelectedShapes } from "utils/utils"
import { getShapeUtils } from "lib/shape-utils"
import { current } from "immer"
import Command from './command'
import history from '../history'
import { StretchType, Data, Edge, Corner } from 'types'
import { getCommonBounds, getPage, getSelectedShapes } from 'utils/utils'
import { getShapeUtils } from 'lib/shape-utils'
import { current } from 'immer'
export default function stretchCommand(data: Data, type: StretchType) {
const { currentPageId } = data
@ -17,8 +17,8 @@ export default function stretchCommand(data: Data, type: StretchType) {
history.execute(
data,
new Command({
name: "stretched",
category: "canvas",
name: 'stretched_shapes',
category: 'canvas',
do(data) {
const { shapes } = getPage(data, currentPageId)

View file

@ -5,7 +5,6 @@ import {
getDocumentBranch,
getPage,
getSelectedIds,
getSelectedShapes,
setToArray,
} from 'utils/utils'
import { getShapeUtils } from 'lib/shape-utils'
@ -25,7 +24,7 @@ export default function styleCommand(data: Data, styles: Partial<ShapeStyles>) {
history.execute(
data,
new Command({
name: 'changed_style',
name: 'style_shapes',
category: 'canvas',
manualSelection: true,
do(data) {

View file

@ -19,7 +19,7 @@ export default function toggleCommand(
history.execute(
data,
new Command({
name: 'toggle_shape_prop',
name: 'toggle_prop',
category: 'canvas',
do(data) {
const { shapes } = getPage(data, currentPageId)

View file

@ -1,15 +1,9 @@
import Command from './command'
import history from '../history'
import { Data, Corner, Edge } from 'types'
import { getShapeUtils } from 'lib/shape-utils'
import { Data } from 'types'
import { current } from 'immer'
import { TransformSingleSnapshot } from 'state/sessions/transform-single-session'
import {
getPage,
getSelectedIds,
setSelectedIds,
updateParents,
} from 'utils/utils'
import { getPage, setSelectedIds, updateParents } from 'utils/utils'
export default function transformSingleCommand(
data: Data,

View file

@ -1,7 +1,7 @@
import Command from './command'
import history from '../history'
import { TranslateSnapshot } from 'state/sessions/translate-session'
import { Data, GroupShape, Shape, ShapeType } from 'types'
import { Data, ShapeType } from 'types'
import {
getDocumentBranch,
getPage,
@ -9,7 +9,6 @@ import {
updateParents,
} from 'utils/utils'
import { getShapeUtils } from 'lib/shape-utils'
import { uniqueId } from 'utils/utils'
export default function translateCommand(
data: Data,

View file

@ -1,17 +1,14 @@
import Command from './command'
import history from '../history'
import { Data, GroupShape, Shape, ShapeType } from 'types'
import { Data, ShapeType } from 'types'
import {
getCommonBounds,
getPage,
getSelectedShapes,
getShape,
setSelectedIds,
} from 'utils/utils'
import { current } from 'immer'
import { createShape, getShapeUtils } from 'lib/shape-utils'
import { PropsOfType } from 'types'
import { uniqueId } from 'utils/utils'
import { getShapeUtils } from 'lib/shape-utils'
export default function ungroupCommand(data: Data) {
const cData = current(data)