@player-tools/json-language-service 0.5.3-next.0 → 0.6.0-next.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.
@@ -154,43 +154,47 @@ var import_jsonc_parser2 = require("jsonc-parser");
154
154
 
155
155
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-service/src/parser/types.ts
156
156
  var ASTNodeImpl = class {
157
+ parent;
158
+ jsonNode;
157
159
  constructor(jsonNode, parent) {
158
160
  this.jsonNode = jsonNode;
159
161
  this.parent = parent;
160
162
  }
161
163
  };
162
164
  var StringASTNodeImpl = class extends ASTNodeImpl {
165
+ type = "string";
166
+ value;
163
167
  constructor(jsonNode, parent) {
164
168
  super(jsonNode, parent);
165
- this.type = "string";
166
169
  this.value = jsonNode.value;
167
170
  }
168
171
  };
169
172
  var NumberASTNodeImpl = class extends ASTNodeImpl {
173
+ type = "number";
174
+ value;
170
175
  constructor(jsonNode, parent) {
171
176
  super(jsonNode, parent);
172
- this.type = "number";
173
177
  this.value = jsonNode.value;
174
178
  }
175
179
  };
176
180
  var BooleanASTNodeImpl = class extends ASTNodeImpl {
181
+ type = "boolean";
182
+ value;
177
183
  constructor(jsonNode, parent) {
178
184
  super(jsonNode, parent);
179
- this.type = "boolean";
180
185
  this.value = jsonNode.value;
181
186
  }
182
187
  };
183
188
  var NullASTNodeImpl = class extends ASTNodeImpl {
184
- constructor() {
185
- super(...arguments);
186
- this.type = "null";
187
- this.value = null;
188
- }
189
+ type = "null";
190
+ value = null;
189
191
  };
190
192
  var PropertyASTNodeImpl = class extends ASTNodeImpl {
193
+ type = "property";
194
+ keyNode;
195
+ valueNode;
191
196
  constructor(jsonNode, parent, keyNode) {
192
197
  super(jsonNode, parent);
193
- this.type = "property";
194
198
  this.keyNode = keyNode;
195
199
  }
196
200
  get children() {
@@ -198,92 +202,68 @@ var PropertyASTNodeImpl = class extends ASTNodeImpl {
198
202
  }
199
203
  };
200
204
  var ViewASTNodeImpl = class extends ASTNodeImpl {
201
- constructor() {
202
- super(...arguments);
203
- this.type = "view";
204
- this.properties = [];
205
- this.id = void 0;
206
- this.viewType = void 0;
207
- }
205
+ type = "view";
206
+ properties = [];
207
+ id = void 0;
208
+ viewType = void 0;
208
209
  get children() {
209
210
  return this.properties;
210
211
  }
211
212
  };
212
213
  var ContentASTNodeImpl = class extends ASTNodeImpl {
213
- constructor() {
214
- super(...arguments);
215
- this.type = "content";
216
- this.properties = [];
217
- this.views = void 0;
218
- this.navigation = void 0;
219
- }
214
+ type = "content";
215
+ properties = [];
216
+ views = void 0;
217
+ navigation = void 0;
220
218
  get children() {
221
219
  return this.properties;
222
220
  }
223
221
  };
224
222
  var NavigationASTNodeImpl = class extends ASTNodeImpl {
225
- constructor() {
226
- super(...arguments);
227
- this.type = "navigation";
228
- this.properties = [];
229
- this.begin = void 0;
230
- this.flows = [];
231
- }
223
+ type = "navigation";
224
+ properties = [];
225
+ begin = void 0;
226
+ flows = [];
232
227
  get children() {
233
228
  return this.properties;
234
229
  }
235
230
  };
236
231
  var FlowASTNodeImpl = class extends ASTNodeImpl {
237
- constructor() {
238
- super(...arguments);
239
- this.type = "flow";
240
- this.properties = [];
241
- this.start = void 0;
242
- this.states = [];
243
- }
232
+ type = "flow";
233
+ properties = [];
234
+ start = void 0;
235
+ states = [];
244
236
  get children() {
245
237
  return this.properties;
246
238
  }
247
239
  };
248
240
  var FlowStateASTNodeImpl = class extends ASTNodeImpl {
249
- constructor() {
250
- super(...arguments);
251
- this.type = "state";
252
- this.properties = [];
253
- this.stateType = void 0;
254
- }
241
+ type = "state";
242
+ properties = [];
243
+ stateType = void 0;
255
244
  get children() {
256
245
  return this.properties;
257
246
  }
258
247
  };
259
248
  var AssetASTNodeImpl = class extends ASTNodeImpl {
260
- constructor() {
261
- super(...arguments);
262
- this.type = "asset";
263
- this.properties = [];
264
- this.id = void 0;
265
- this.assetType = void 0;
266
- }
249
+ type = "asset";
250
+ properties = [];
251
+ id = void 0;
252
+ assetType = void 0;
267
253
  get children() {
268
254
  return this.properties;
269
255
  }
270
256
  };
271
257
  var ArrayASTNodeImpl = class extends ASTNodeImpl {
272
- constructor() {
273
- super(...arguments);
274
- this.type = "array";
275
- this.items = [];
276
- }
258
+ type = "array";
259
+ items = [];
277
260
  get children() {
278
261
  return this.items;
279
262
  }
280
263
  };
281
264
  var ObjectASTNodeImpl = class extends ASTNodeImpl {
282
- constructor() {
283
- super(...arguments);
284
- this.type = "object";
285
- this.properties = [];
286
- }
265
+ type = "object";
266
+ properties = [];
287
267
  get children() {
288
268
  return this.properties;
289
269
  }
@@ -332,6 +312,9 @@ function isStringProperty(node) {
332
312
  return node.valueNode?.type === "string";
333
313
  }
334
314
  var PlayerContent = class {
315
+ root;
316
+ syntaxErrors;
317
+ jsonNodeToNode;
335
318
  constructor(root, errors, jsonToNodeMap) {
336
319
  this.root = root;
337
320
  this.jsonNodeToNode = jsonToNodeMap;
@@ -804,9 +787,7 @@ var checkSwitchCase = (node) => {
804
787
  return node.value === "staticSwitch" || node.value === "dynamicSwitch";
805
788
  };
806
789
  var AssetWrapperArrayPlugin = class {
807
- constructor() {
808
- this.name = "asset-wrapper-to-array";
809
- }
790
+ name = "asset-wrapper-to-array";
810
791
  apply(service) {
811
792
  service.hooks.validate.tap(
812
793
  this.name,
@@ -994,9 +975,7 @@ function getLocationForSchemaType(ctx, schemaInfo) {
994
975
  }
995
976
  }
996
977
  var SchemaInfoPlugin = class {
997
- constructor() {
998
- this.name = "view-node";
999
- }
978
+ name = "view-node";
1000
979
  apply(service) {
1001
980
  let schemaInfo;
1002
981
  service.hooks.onDocumentUpdate.tap(this.name, (ctx) => {
@@ -1269,9 +1248,7 @@ function hover(ctx) {
1269
1248
  }
1270
1249
  }
1271
1250
  var XLRPlugin = class {
1272
- constructor() {
1273
- this.name = "xlr-plugin";
1274
- }
1251
+ name = "xlr-plugin";
1275
1252
  apply(service) {
1276
1253
  service.hooks.validate.tap(this.name, async (ctx, validation) => {
1277
1254
  validation.useASTVisitor(
@@ -1358,9 +1335,7 @@ var createValidationVisitor2 = (ctx) => {
1358
1335
  };
1359
1336
  };
1360
1337
  var DuplicateIDPlugin = class {
1361
- constructor() {
1362
- this.name = "duplicate-id";
1363
- }
1338
+ name = "duplicate-id";
1364
1339
  apply(service) {
1365
1340
  service.hooks.validate.tap(this.name, async (ctx, validation) => {
1366
1341
  validation.useASTVisitor(createValidationVisitor2(validation));
@@ -1416,9 +1391,7 @@ function createRuleVisitor(context) {
1416
1391
  };
1417
1392
  }
1418
1393
  var LegacyActionPlugin = class {
1419
- constructor() {
1420
- this.name = "legacy-action";
1421
- }
1394
+ name = "legacy-action";
1422
1395
  apply(service) {
1423
1396
  service.hooks.validate.tap(this.name, async (ctx, validationContext) => {
1424
1397
  validationContext.useASTVisitor(createRuleVisitor(validationContext));
@@ -1498,9 +1471,7 @@ function createRuleVisitor2(context, docInfo) {
1498
1471
  };
1499
1472
  }
1500
1473
  var LegacyTemplatePlugin = class {
1501
- constructor() {
1502
- this.name = "legacy-template";
1503
- }
1474
+ name = "legacy-template";
1504
1475
  apply(service) {
1505
1476
  service.hooks.validate.tap(this.name, async (ctx, validationContext) => {
1506
1477
  validationContext.useASTVisitor(
@@ -1521,9 +1492,7 @@ var getObjectTarget = (node) => {
1521
1492
  }
1522
1493
  };
1523
1494
  var MissingAssetWrapperPlugin = class {
1524
- constructor() {
1525
- this.name = "missing-asset-wrapper";
1526
- }
1495
+ name = "missing-asset-wrapper";
1527
1496
  apply(languageService) {
1528
1497
  languageService.hooks.onValidateEnd.tap(
1529
1498
  this.name,
@@ -1621,9 +1590,7 @@ var getFlowNode = (node) => {
1621
1590
  }
1622
1591
  };
1623
1592
  var NavStatePlugin = class {
1624
- constructor() {
1625
- this.name = "nav-state";
1626
- }
1593
+ name = "nav-state";
1627
1594
  apply(service) {
1628
1595
  service.hooks.validate.tap(this.name, async (ctx, validation) => {
1629
1596
  validation.useASTVisitor(createValidationVisitor3(validation));
@@ -1730,9 +1697,7 @@ var getViewInfo = (ctx) => {
1730
1697
  };
1731
1698
  };
1732
1699
  var ViewNodePlugin = class {
1733
- constructor() {
1734
- this.name = "view-node";
1735
- }
1700
+ name = "view-node";
1736
1701
  apply(service) {
1737
1702
  let viewInfo;
1738
1703
  service.hooks.validate.tap(this.name, async (ctx, validation) => {
@@ -1931,6 +1896,8 @@ var TRANSFORM_FUNCTIONS = [
1931
1896
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-service/src/xlr/registry.ts
1932
1897
  var import_xlr_sdk2 = require("@player-tools/xlr-sdk");
1933
1898
  var PlayerXLRRegistry = class extends import_xlr_sdk2.BasicXLRRegistry {
1899
+ /** Keeps the mapping of how a type is referenced by Player to the underlying XLR */
1900
+ registrationMap;
1934
1901
  constructor() {
1935
1902
  super();
1936
1903
  this.registrationMap = /* @__PURE__ */ new Map();
@@ -2001,15 +1968,16 @@ var PlayerXLRRegistry = class extends import_xlr_sdk2.BasicXLRRegistry {
2001
1968
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-service/src/xlr/service.ts
2002
1969
  var import_xlr_sdk3 = require("@player-tools/xlr-sdk");
2003
1970
  var XLRService = class {
1971
+ baseTypes = [
1972
+ "asset",
1973
+ "view",
1974
+ "flow",
1975
+ "content",
1976
+ "navigation",
1977
+ "state"
1978
+ ];
1979
+ XLRSDK;
2004
1980
  constructor() {
2005
- this.baseTypes = [
2006
- "asset",
2007
- "view",
2008
- "flow",
2009
- "content",
2010
- "navigation",
2011
- "state"
2012
- ];
2013
1981
  this.XLRSDK = new import_xlr_sdk3.XLRSDK(new PlayerXLRRegistry());
2014
1982
  }
2015
1983
  walker(n, path) {
@@ -2131,17 +2099,18 @@ var LOG_TYPES = ["debug", "info", "warn", "error"];
2131
2099
 
2132
2100
  // ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-service/src/index.ts
2133
2101
  var PlayerLanguageService = class {
2102
+ XLRService;
2103
+ parseCache = /* @__PURE__ */ new Map();
2104
+ fixableViolationsForDocument = /* @__PURE__ */ new Map();
2105
+ hooks = {
2106
+ onDocumentUpdate: new import_tapable_ts.SyncHook(),
2107
+ validate: new import_tapable_ts.AsyncParallelHook(),
2108
+ onValidateEnd: new import_tapable_ts.SyncWaterfallHook(),
2109
+ complete: new import_tapable_ts.AsyncParallelHook(),
2110
+ hover: new import_tapable_ts.SyncBailHook(),
2111
+ definition: new import_tapable_ts.SyncBailHook()
2112
+ };
2134
2113
  constructor(config) {
2135
- this.parseCache = /* @__PURE__ */ new Map();
2136
- this.fixableViolationsForDocument = /* @__PURE__ */ new Map();
2137
- this.hooks = {
2138
- onDocumentUpdate: new import_tapable_ts.SyncHook(),
2139
- validate: new import_tapable_ts.AsyncParallelHook(),
2140
- onValidateEnd: new import_tapable_ts.SyncWaterfallHook(),
2141
- complete: new import_tapable_ts.AsyncParallelHook(),
2142
- hover: new import_tapable_ts.SyncBailHook(),
2143
- definition: new import_tapable_ts.SyncBailHook()
2144
- };
2145
2114
  this.XLRService = new XLRService();
2146
2115
  PLUGINS.forEach((p) => p.apply(this));
2147
2116
  config?.plugins?.forEach((p) => p.apply(this));