@zcomponent/core 1.22.0 → 1.22.1

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.
@@ -121,6 +121,12 @@ export declare function getSafeKeyName(n: string): string;
121
121
  export declare function propertyTracksByEntityID(clip: Data.Clip): {
122
122
  [id: string]: Data.PropertyTrack[];
123
123
  };
124
+ export declare function clipNamesForEntitiesByProp(animation: Data.Animation, entityIDs: Set<string>): {
125
+ [propName: string]: Set<string>;
126
+ };
127
+ export declare function entitiesWithAnimation(animation: Data.Animation): {
128
+ [id: string]: Set<string>;
129
+ };
124
130
  /**
125
131
  * Generates a behavior block for a node, based on the behaviors and their IDs.
126
132
  *
package/lib/selectors.js CHANGED
@@ -168,7 +168,7 @@ export function getScriptNameForNodeLabel(zcomp, label) {
168
168
  }
169
169
  return getScriptName(label, uniques);
170
170
  }
171
- const variableNameRegex = new RegExp(/[a-zA-Z_$][0-9a-zA-Z_$]*/);
171
+ const variableNameRegex = new RegExp(/^[a-zA-Z_$][0-9a-zA-Z_$]*$/);
172
172
  /**
173
173
  * Checks if a given string is a valid variable name.
174
174
  *
@@ -480,6 +480,42 @@ export function propertyTracksByEntityID(clip) {
480
480
  }
481
481
  return ret;
482
482
  }
483
+ export function clipNamesForEntitiesByProp(animation, entityIDs) {
484
+ const ret = Object.create(null);
485
+ for (const clip of Object.values(animation.clips)) {
486
+ if (!clip)
487
+ continue;
488
+ for (const track of Object.values(clip.tracks)) {
489
+ if (!track)
490
+ continue;
491
+ if (track.type !== Data.TrackType.Property)
492
+ continue;
493
+ if (!entityIDs.has(track.entityID))
494
+ continue;
495
+ const propName = Array.isArray(track.property) ? track.property[0] : track.property;
496
+ const propNameStr = typeof propName === 'number' ? propName.toString() : propName;
497
+ ret[propNameStr] = ret[propNameStr] ?? new Set();
498
+ ret[propNameStr].add(clip.name);
499
+ }
500
+ }
501
+ return ret;
502
+ }
503
+ export function entitiesWithAnimation(animation) {
504
+ const ret = Object.create(null);
505
+ for (const clip of Object.values(animation.clips)) {
506
+ if (!clip)
507
+ continue;
508
+ for (const track of Object.values(clip.tracks)) {
509
+ if (!track)
510
+ continue;
511
+ if (track.type !== Data.TrackType.Property)
512
+ continue;
513
+ ret[track.entityID] = ret[track.entityID] ?? new Set();
514
+ ret[track.entityID].add(clip.name);
515
+ }
516
+ }
517
+ return ret;
518
+ }
483
519
  /**
484
520
  * Generates a behavior block for a node, based on the behaviors and their IDs.
485
521
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zcomponent/core",
3
- "version": "1.22.0",
3
+ "version": "1.22.1",
4
4
  "description": "The core component model and built-in functionality for Mattercraft.",
5
5
  "author": "Zappar Limited",
6
6
  "license": "Proprietary",
@@ -62,32 +62,7 @@
62
62
  "@semantic-release/changelog",
63
63
  "@semantic-release/npm",
64
64
  "@semantic-release/gitlab",
65
- [
66
- "@semantic-release/git",
67
- {
68
- "assets": [
69
- "package.json",
70
- "packages/*/package.json",
71
- "packages/*/CHANGELOG.md"
72
- ],
73
- "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
74
- }
75
- ],
76
- [
77
- "@rimac-technology/semantic-release-s3",
78
- {
79
- "s3Bucket": {
80
- "main": "mattercraft-api-docs/prod",
81
- "beta": "mattercraft-api-docs-beta/beta",
82
- "alpha": "mattercraft-api-docs-alpha/alpha"
83
- },
84
- "directoryPath": "../../docs/**/*",
85
- "objectACL": "",
86
- "removeDirectoryRoot": true,
87
- "awsAccessKeyName": "DOCS_AWS_ACCESS_KEY_ID",
88
- "awsSecretAccessKeyName": "DOCS_AWS_SECRET_ACCESS_KEY"
89
- }
90
- ]
65
+ "@semantic-release/git"
91
66
  ],
92
67
  "tagFormat": "@zcomponent/core@${version}"
93
68
  }