123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809 |
- // Jest Snapshot v1, https://goo.gl/fbAQLP
-
- exports[`project loads file from json: data after mount from file 1`] = `
- Object {
- "code": Object {
- "file0": Object {
- "code": "
- const draw = new Draw({
- points: [
- ...Utils.getPointsBetween([0, 0], [20, 50]),
- ...Utils.getPointsBetween([20, 50], [100, 20], 3),
- ...Utils.getPointsBetween([100, 20], [100, 100], 10),
- [100, 100],
- ],
- })
-
- const rectangle = new Rectangle({
- point: [200, 0],
- style: {
- color: ColorStyle.Blue,
- },
- })
-
- const ellipse = new Ellipse({
- point: [400, 0],
- })
-
- const arrow = new Arrow({
- start: [600, 0],
- end: [700, 100],
- })
-
- const radius = 1000
- const count = 100
- const center = [350, 50]
-
- for (let i = 0; i < count; i++) {
- const point = Vec.rotWith(
- Vec.add(center, [radius, 0]),
- center,
- (Math.PI * 2 * i) / count
- )
-
- const dot = new Dot({
- point,
- })
- }
- ",
- "id": "file0",
- "name": "index.ts",
- },
- },
- "id": "TESTING",
- "name": "My Document",
- "pages": Object {
- "page1": Object {
- "childIndex": 0,
- "id": "page1",
- "name": "Page 1",
- "shapes": Object {
- "13448777-d8f5-46cd-8a70-a4259211902e": Object {
- "childIndex": 4,
- "id": "13448777-d8f5-46cd-8a70-a4259211902e",
- "name": "Rectangle",
- "parentId": "page1",
- "point": Array [
- 500,
- 400,
- ],
- "radius": 2,
- "rotation": 0,
- "size": Array [
- 200,
- 200,
- ],
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "rectangle",
- },
- "2d842ace-ebc5-4e83-acdf-de29352e5e62": Object {
- "bend": 0,
- "childIndex": 10,
- "decorations": Object {
- "end": "Arrow",
- "middle": null,
- "start": null,
- },
- "handles": Object {
- "bend": Object {
- "id": "bend",
- "index": 2,
- "point": Array [
- 1.2250000000000227,
- 92.60000000000002,
- ],
- },
- "end": Object {
- "id": "end",
- "index": 1,
- "point": Array [
- 2.4500000000000455,
- 185.20000000000005,
- ],
- },
- "start": Object {
- "id": "start",
- "index": 0,
- "point": Array [
- 0,
- 0,
- ],
- },
- },
- "id": "2d842ace-ebc5-4e83-acdf-de29352e5e62",
- "name": "Arrow",
- "parentId": "page1",
- "point": Array [
- 616.9,
- 1124.3,
- ],
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "arrow",
- },
- "38e9e750-16c2-4476-93ab-21aeb5f8858f": Object {
- "childIndex": 12,
- "id": "38e9e750-16c2-4476-93ab-21aeb5f8858f",
- "name": "Text",
- "parentId": "page1",
- "point": Array [
- 207.16,
- 1422.4,
- ],
- "rotation": 0,
- "scale": 1,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "text": "Hello",
- "type": "text",
- },
- "3c688979-b190-4270-915b-7d8dd22a2bb7": Object {
- "childIndex": 14,
- "id": "3c688979-b190-4270-915b-7d8dd22a2bb7",
- "name": "Text",
- "parentId": "page1",
- "point": Array [
- 564.06,
- 1558.1,
- ],
- "rotation": 0,
- "scale": 1,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "text": "Hello",
- "type": "text",
- },
- "51641de1-9787-41b8-afcc-2c85fd1b24c7": Object {
- "childIndex": 7,
- "id": "51641de1-9787-41b8-afcc-2c85fd1b24c7",
- "name": "Ellipse",
- "parentId": "page1",
- "point": Array [
- 517.18,
- 783.54,
- ],
- "radiusX": 102.99999999999997,
- "radiusY": 102.99999999999994,
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "ellipse",
- },
- "5ba998df-c036-447a-9b88-d96c71394f52": Object {
- "childIndex": 13,
- "id": "5ba998df-c036-447a-9b88-d96c71394f52",
- "name": "Text",
- "parentId": "page1",
- "point": Array [
- 389.57,
- 1496.5,
- ],
- "rotation": 0,
- "scale": 1,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "text": "Hello",
- "type": "text",
- },
- "75010635-8dfb-48ea-9250-719e50e58f02": Object {
- "childIndex": 5,
- "id": "75010635-8dfb-48ea-9250-719e50e58f02",
- "name": "Rectangle",
- "parentId": "page1",
- "point": Array [
- 384.09,
- 378.45,
- ],
- "radius": 2,
- "rotation": 0,
- "size": Array [
- 95.20999999999992,
- 91.1799999999999,
- ],
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "rectangle",
- },
- "b8e4e2c5-c662-4587-bf80-b9820ad8ad7f": Object {
- "bend": 0,
- "childIndex": 11,
- "decorations": Object {
- "end": "Arrow",
- "middle": null,
- "start": null,
- },
- "handles": Object {
- "bend": Object {
- "id": "bend",
- "index": 2,
- "point": Array [
- 0.9250000000000114,
- 47.85000000000002,
- ],
- },
- "end": Object {
- "id": "end",
- "index": 1,
- "point": Array [
- 1.8500000000000227,
- 95.70000000000005,
- ],
- },
- "start": Object {
- "id": "start",
- "index": 0,
- "point": Array [
- 0,
- 0,
- ],
- },
- },
- "id": "b8e4e2c5-c662-4587-bf80-b9820ad8ad7f",
- "name": "Arrow",
- "parentId": "page1",
- "point": Array [
- 425.18,
- 1143.2,
- ],
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "arrow",
- },
- "c892d665-3311-4e25-a0bf-c4632d777f7e": Object {
- "childIndex": 6,
- "id": "c892d665-3311-4e25-a0bf-c4632d777f7e",
- "name": "Ellipse",
- "parentId": "page1",
- "point": Array [
- 162.45,
- 679.23,
- ],
- "radiusX": 102.99999999999997,
- "radiusY": 102.99999999999994,
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "ellipse",
- },
- "e08c415e-3db3-4d3b-878e-28ce693ec1b0": Object {
- "childIndex": 8,
- "id": "e08c415e-3db3-4d3b-878e-28ce693ec1b0",
- "name": "Ellipse",
- "parentId": "page1",
- "point": Array [
- 398.99,
- 810.79,
- ],
- "radiusX": 45.484999999999985,
- "radiusY": 45.48499999999996,
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "ellipse",
- },
- "e43559cb-6f41-4ae4-9c49-158ed1ad2f72": Object {
- "childIndex": 3,
- "id": "e43559cb-6f41-4ae4-9c49-158ed1ad2f72",
- "name": "Rectangle",
- "parentId": "page1",
- "point": Array [
- 100,
- 100,
- ],
- "radius": 2,
- "rotation": 0,
- "size": Array [
- 100,
- 100,
- ],
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "rectangle",
- },
- "fee77127-e779-4576-882b-b1bf7c7e132f": Object {
- "bend": 0,
- "childIndex": 9,
- "decorations": Object {
- "end": "Arrow",
- "middle": null,
- "start": null,
- },
- "handles": Object {
- "bend": Object {
- "id": "bend",
- "index": 2,
- "point": Array [
- 0.045000000000001705,
- 104,
- ],
- },
- "end": Object {
- "id": "end",
- "index": 1,
- "point": Array [
- 0.09000000000000341,
- 208,
- ],
- },
- "start": Object {
- "id": "start",
- "index": 0,
- "point": Array [
- 0,
- 0,
- ],
- },
- },
- "id": "fee77127-e779-4576-882b-b1bf7c7e132f",
- "name": "Arrow",
- "parentId": "page1",
- "point": Array [
- 252.85,
- 1057.5,
- ],
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "arrow",
- },
- },
- "type": "page",
- },
- },
- }
- `;
-
- exports[`restoring project remounts the state after mutating the current state: data after re-mount from file 1`] = `
- Object {
- "code": Object {
- "file0": Object {
- "code": "
- const draw = new Draw({
- points: [
- ...Utils.getPointsBetween([0, 0], [20, 50]),
- ...Utils.getPointsBetween([20, 50], [100, 20], 3),
- ...Utils.getPointsBetween([100, 20], [100, 100], 10),
- [100, 100],
- ],
- })
-
- const rectangle = new Rectangle({
- point: [200, 0],
- style: {
- color: ColorStyle.Blue,
- },
- })
-
- const ellipse = new Ellipse({
- point: [400, 0],
- })
-
- const arrow = new Arrow({
- start: [600, 0],
- end: [700, 100],
- })
-
- const radius = 1000
- const count = 100
- const center = [350, 50]
-
- for (let i = 0; i < count; i++) {
- const point = Vec.rotWith(
- Vec.add(center, [radius, 0]),
- center,
- (Math.PI * 2 * i) / count
- )
-
- const dot = new Dot({
- point,
- })
- }
- ",
- "id": "file0",
- "name": "index.ts",
- },
- },
- "id": "TESTING",
- "name": "My Document",
- "pages": Object {
- "page1": Object {
- "childIndex": 0,
- "id": "page1",
- "name": "Page 1",
- "shapes": Object {
- "13448777-d8f5-46cd-8a70-a4259211902e": Object {
- "childIndex": 4,
- "id": "13448777-d8f5-46cd-8a70-a4259211902e",
- "name": "Rectangle",
- "parentId": "page1",
- "point": Array [
- 500,
- 400,
- ],
- "radius": 2,
- "rotation": 0,
- "size": Array [
- 200,
- 200,
- ],
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "rectangle",
- },
- "2d842ace-ebc5-4e83-acdf-de29352e5e62": Object {
- "bend": 0,
- "childIndex": 10,
- "decorations": Object {
- "end": "Arrow",
- "middle": null,
- "start": null,
- },
- "handles": Object {
- "bend": Object {
- "id": "bend",
- "index": 2,
- "point": Array [
- 1.2250000000000227,
- 92.60000000000002,
- ],
- },
- "end": Object {
- "id": "end",
- "index": 1,
- "point": Array [
- 2.4500000000000455,
- 185.20000000000005,
- ],
- },
- "start": Object {
- "id": "start",
- "index": 0,
- "point": Array [
- 0,
- 0,
- ],
- },
- },
- "id": "2d842ace-ebc5-4e83-acdf-de29352e5e62",
- "name": "Arrow",
- "parentId": "page1",
- "point": Array [
- 616.9,
- 1124.3,
- ],
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "arrow",
- },
- "38e9e750-16c2-4476-93ab-21aeb5f8858f": Object {
- "childIndex": 12,
- "id": "38e9e750-16c2-4476-93ab-21aeb5f8858f",
- "name": "Text",
- "parentId": "page1",
- "point": Array [
- 207.16,
- 1422.4,
- ],
- "rotation": 0,
- "scale": 1,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "text": "Hello",
- "type": "text",
- },
- "3c688979-b190-4270-915b-7d8dd22a2bb7": Object {
- "childIndex": 14,
- "id": "3c688979-b190-4270-915b-7d8dd22a2bb7",
- "name": "Text",
- "parentId": "page1",
- "point": Array [
- 564.06,
- 1558.1,
- ],
- "rotation": 0,
- "scale": 1,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "text": "Hello",
- "type": "text",
- },
- "51641de1-9787-41b8-afcc-2c85fd1b24c7": Object {
- "childIndex": 7,
- "id": "51641de1-9787-41b8-afcc-2c85fd1b24c7",
- "name": "Ellipse",
- "parentId": "page1",
- "point": Array [
- 517.18,
- 783.54,
- ],
- "radiusX": 102.99999999999997,
- "radiusY": 102.99999999999994,
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "ellipse",
- },
- "5ba998df-c036-447a-9b88-d96c71394f52": Object {
- "childIndex": 13,
- "id": "5ba998df-c036-447a-9b88-d96c71394f52",
- "name": "Text",
- "parentId": "page1",
- "point": Array [
- 389.57,
- 1496.5,
- ],
- "rotation": 0,
- "scale": 1,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "text": "Hello",
- "type": "text",
- },
- "75010635-8dfb-48ea-9250-719e50e58f02": Object {
- "childIndex": 5,
- "id": "75010635-8dfb-48ea-9250-719e50e58f02",
- "name": "Rectangle",
- "parentId": "page1",
- "point": Array [
- 384.09,
- 378.45,
- ],
- "radius": 2,
- "rotation": 0,
- "size": Array [
- 95.20999999999992,
- 91.1799999999999,
- ],
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "rectangle",
- },
- "b8e4e2c5-c662-4587-bf80-b9820ad8ad7f": Object {
- "bend": 0,
- "childIndex": 11,
- "decorations": Object {
- "end": "Arrow",
- "middle": null,
- "start": null,
- },
- "handles": Object {
- "bend": Object {
- "id": "bend",
- "index": 2,
- "point": Array [
- 0.9250000000000114,
- 47.85000000000002,
- ],
- },
- "end": Object {
- "id": "end",
- "index": 1,
- "point": Array [
- 1.8500000000000227,
- 95.70000000000005,
- ],
- },
- "start": Object {
- "id": "start",
- "index": 0,
- "point": Array [
- 0,
- 0,
- ],
- },
- },
- "id": "b8e4e2c5-c662-4587-bf80-b9820ad8ad7f",
- "name": "Arrow",
- "parentId": "page1",
- "point": Array [
- 425.18,
- 1143.2,
- ],
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "arrow",
- },
- "c892d665-3311-4e25-a0bf-c4632d777f7e": Object {
- "childIndex": 6,
- "id": "c892d665-3311-4e25-a0bf-c4632d777f7e",
- "name": "Ellipse",
- "parentId": "page1",
- "point": Array [
- 162.45,
- 679.23,
- ],
- "radiusX": 102.99999999999997,
- "radiusY": 102.99999999999994,
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "ellipse",
- },
- "e08c415e-3db3-4d3b-878e-28ce693ec1b0": Object {
- "childIndex": 8,
- "id": "e08c415e-3db3-4d3b-878e-28ce693ec1b0",
- "name": "Ellipse",
- "parentId": "page1",
- "point": Array [
- 398.99,
- 810.79,
- ],
- "radiusX": 45.484999999999985,
- "radiusY": 45.48499999999996,
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "ellipse",
- },
- "e43559cb-6f41-4ae4-9c49-158ed1ad2f72": Object {
- "childIndex": 3,
- "id": "e43559cb-6f41-4ae4-9c49-158ed1ad2f72",
- "name": "Rectangle",
- "parentId": "page1",
- "point": Array [
- 100,
- 100,
- ],
- "radius": 2,
- "rotation": 0,
- "size": Array [
- 100,
- 100,
- ],
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "rectangle",
- },
- "fee77127-e779-4576-882b-b1bf7c7e132f": Object {
- "bend": 0,
- "childIndex": 9,
- "decorations": Object {
- "end": "Arrow",
- "middle": null,
- "start": null,
- },
- "handles": Object {
- "bend": Object {
- "id": "bend",
- "index": 2,
- "point": Array [
- 0.045000000000001705,
- 104,
- ],
- },
- "end": Object {
- "id": "end",
- "index": 1,
- "point": Array [
- 0.09000000000000341,
- 208,
- ],
- },
- "start": Object {
- "id": "start",
- "index": 0,
- "point": Array [
- 0,
- 0,
- ],
- },
- },
- "id": "fee77127-e779-4576-882b-b1bf7c7e132f",
- "name": "Arrow",
- "parentId": "page1",
- "point": Array [
- 252.85,
- 1057.5,
- ],
- "rotation": 0,
- "style": Object {
- "color": "Black",
- "dash": "Draw",
- "isFilled": false,
- "size": "Medium",
- },
- "type": "arrow",
- },
- },
- "type": "page",
- },
- },
- }
- `;
|