@operato/scene-clone 8.0.0-beta.1 → 8.0.0
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/package.json +5 -5
- package/CHANGELOG.md +0 -873
- package/demo/index-clone-bug-2.html +0 -188
- package/demo/index-clone-bug.html +0 -185
- package/demo/index-polyline-outline.html +0 -368
- package/demo/index.html +0 -174
- package/demo/things-scene-clone.html +0 -5
- package/src/clone.ts +0 -140
- package/src/index.ts +0 -1
- package/src/templates/index.ts +0 -20
- package/test/basic-test.html +0 -67
- package/test/index.html +0 -22
- package/test/unit/test-clone.js +0 -28
- package/test/unit/util.js +0 -18
- package/tsconfig.json +0 -24
- package/tsconfig.tsbuildinfo +0 -1
package/src/templates/index.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const icon = new URL('../../icons/clone.png', import.meta.url).href
|
|
2
|
-
|
|
3
|
-
export default [
|
|
4
|
-
{
|
|
5
|
-
type: 'clone',
|
|
6
|
-
description: 'component cloner',
|
|
7
|
-
group: 'etc',
|
|
8
|
-
icon,
|
|
9
|
-
model: {
|
|
10
|
-
type: 'clone',
|
|
11
|
-
top: 350,
|
|
12
|
-
left: 100,
|
|
13
|
-
width: 30,
|
|
14
|
-
height: 30,
|
|
15
|
-
strokeStyle: '#999',
|
|
16
|
-
lineWidth: 1,
|
|
17
|
-
lineStyle: '#999'
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
]
|
package/test/basic-test.html
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<!--
|
|
3
|
-
@license
|
|
4
|
-
Copyright © 2017 HatioLab Inc. All rights reserved.
|
|
5
|
-
-->
|
|
6
|
-
<html>
|
|
7
|
-
<head>
|
|
8
|
-
<meta charset="utf-8">
|
|
9
|
-
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
|
10
|
-
|
|
11
|
-
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
|
12
|
-
<script src="../../web-component-tester/browser.js"></script>
|
|
13
|
-
|
|
14
|
-
<!-- Step 1: import the element to test -->
|
|
15
|
-
<link rel="import" href="../things-scene-clone.html">
|
|
16
|
-
</head>
|
|
17
|
-
<body>
|
|
18
|
-
|
|
19
|
-
<!-- You can use the document as a place to set up your fixtures. -->
|
|
20
|
-
<test-fixture id="things-scene-clone-fixture">
|
|
21
|
-
<template>
|
|
22
|
-
<things-scene-clone>
|
|
23
|
-
<h2>things-scene-clone</h2>
|
|
24
|
-
</things-scene-clone>
|
|
25
|
-
</template>
|
|
26
|
-
</test-fixture>
|
|
27
|
-
|
|
28
|
-
<script>
|
|
29
|
-
suite('<things-scene-clone>', function() {
|
|
30
|
-
|
|
31
|
-
var myEl;
|
|
32
|
-
|
|
33
|
-
setup(function() {
|
|
34
|
-
myEl = fixture('things-scene-clone-fixture');
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
test('defines the "author" property', function() {
|
|
38
|
-
assert.equal(myEl.author.name, 'Dimitri Glazkov');
|
|
39
|
-
assert.equal(myEl.author.image, 'http://addyosmani.com/blog/wp-content/uploads/2013/04/unicorn.jpg');
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test('says hello', function() {
|
|
43
|
-
assert.equal(myEl.sayHello(), 'things-scene-clone says, Hello World!');
|
|
44
|
-
|
|
45
|
-
var greetings = myEl.sayHello('greetings Earthlings');
|
|
46
|
-
assert.equal(greetings, 'things-scene-clone says, greetings Earthlings');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
test('fires lasers', function(done) {
|
|
50
|
-
myEl.addEventListener('things-scene-clone-lasers', function(event) {
|
|
51
|
-
assert.equal(event.detail.sound, 'Pew pew!');
|
|
52
|
-
done();
|
|
53
|
-
});
|
|
54
|
-
myEl.fireLasers();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
test('distributed children', function() {
|
|
58
|
-
var els = myEl.getContentChildren();
|
|
59
|
-
assert.equal(els.length, 1, 'one distributed node');
|
|
60
|
-
assert.equal(els[0], myEl.querySelector('h2'), 'content distributed correctly');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
});
|
|
64
|
-
</script>
|
|
65
|
-
|
|
66
|
-
</body>
|
|
67
|
-
</html>
|
package/test/index.html
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<!--
|
|
3
|
-
@license
|
|
4
|
-
Copyright © 2017 HatioLab Inc. All rights reserved.
|
|
5
|
-
-->
|
|
6
|
-
<html><head>
|
|
7
|
-
<meta charset="utf-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
|
9
|
-
|
|
10
|
-
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
|
11
|
-
<script src="../../web-component-tester/browser.js"></script>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<script>
|
|
15
|
-
// Load and run all tests (.html, .js):
|
|
16
|
-
WCT.loadSuites([
|
|
17
|
-
'basic-test.html',
|
|
18
|
-
'basic-test.html?dom=shadow'
|
|
19
|
-
]);
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
</body></html>
|
package/test/unit/test-clone.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import './util'
|
|
2
|
-
import '../../bower_components/things-scene-core/things-scene-min'
|
|
3
|
-
|
|
4
|
-
import { Clone } from '../../src/index'
|
|
5
|
-
import { expect } from 'chai'
|
|
6
|
-
|
|
7
|
-
describe('Clone', function () {
|
|
8
|
-
var board
|
|
9
|
-
|
|
10
|
-
beforeEach(function () {
|
|
11
|
-
board = scene.create({
|
|
12
|
-
model: {
|
|
13
|
-
components: [
|
|
14
|
-
{
|
|
15
|
-
id: 'clone',
|
|
16
|
-
type: 'clone'
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
it('component should be found by its id.', function () {
|
|
24
|
-
var component = board.findById('clone')
|
|
25
|
-
|
|
26
|
-
expect(!!component).not.to.equal(false)
|
|
27
|
-
})
|
|
28
|
-
})
|
package/test/unit/util.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var noop = () => {}
|
|
2
|
-
|
|
3
|
-
global.Canvas = require('canvas')
|
|
4
|
-
|
|
5
|
-
Canvas.prototype.setAttribute = noop
|
|
6
|
-
Canvas.prototype.style = {}
|
|
7
|
-
|
|
8
|
-
global.Image = Canvas.Image
|
|
9
|
-
global.screen = {
|
|
10
|
-
width: 1280,
|
|
11
|
-
height: 800
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
global.window = global
|
|
15
|
-
|
|
16
|
-
global.addEventListener = noop
|
|
17
|
-
global.location = {}
|
|
18
|
-
global.getComputedStyle = noop
|
package/tsconfig.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2018",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"noEmitOnError": true,
|
|
7
|
-
"lib": ["es2019", "dom"],
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": false,
|
|
10
|
-
"allowJs": true,
|
|
11
|
-
"allowSyntheticDefaultImports": true,
|
|
12
|
-
"experimentalDecorators": true,
|
|
13
|
-
"importHelpers": true,
|
|
14
|
-
"outDir": "dist",
|
|
15
|
-
"sourceMap": true,
|
|
16
|
-
"inlineSources": true,
|
|
17
|
-
"rootDir": "src",
|
|
18
|
-
"declaration": true,
|
|
19
|
-
"incremental": true,
|
|
20
|
-
"skipLibCheck": true,
|
|
21
|
-
"types": []
|
|
22
|
-
},
|
|
23
|
-
"include": ["**/*.ts", "*.d.ts"]
|
|
24
|
-
}
|
package/tsconfig.tsbuildinfo
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/tslib/tslib.d.ts","../../node_modules/@hatiolab/things-scene/things-scene.d.ts","./src/clone.ts","./src/index.ts","./src/templates/index.ts"],"fileIdsList":[[38,39],[38,40],[38]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec","impliedFormat":1},{"version":"ef4e4dc2fd14de20903f5010671dab9cf547c831dce4802306676c80649b990b","impliedFormat":1},{"version":"a8b50de03921828bcc62b40b9799a8b3d2ceff7878966446f5827ca295c0b1ad","signature":"85cb8bccb3a55c6f1f46545596496aa0c0cd7948b25078846cee85b16dc99a8d"},{"version":"eea4fe0ec79b712c2bb1ea06e827aa1cf5891947d28f7d846b78cd0f01f8c359","signature":"012dd2a6f9487b470c8eb3db99b9aa576b2fd707c02d6083575bca84f0250fb6"},{"version":"ce691482e7b08c30e8d7fc8458c57fda73f3d580c61f4df240d79731bea4517e","signature":"ed4961952dd275aa3642aa66b27403154ff942756b5a08e37b5c894ac60c9512"}],"root":[[40,42]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":false,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":5},"referencedMap":[[40,1],[41,2],[42,3]],"version":"5.7.2"}
|