@modelform/react-native 0.2.0 → 0.4.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/dist/{chunk-MRHC6AEU.mjs → chunk-ATRMUHKJ.mjs} +394 -113
- package/dist/{chunk-M5R44SAF.js → chunk-WMRDOYPV.js} +396 -115
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +24 -2
- package/dist/core/index.mjs +23 -1
- package/dist/core/layout.d.ts +33 -0
- package/dist/core/layoutEdit.d.ts +60 -17
- package/dist/core/snippets.d.ts +64 -0
- package/dist/index.js +162 -132
- package/dist/index.mjs +32 -2
- package/package.json +1 -1
|
@@ -483,6 +483,32 @@ var GRID_COLUMNS = 24;
|
|
|
483
483
|
var CELL_HEIGHT = 30;
|
|
484
484
|
var CELL_MARGIN = 8;
|
|
485
485
|
var gridUnitsToPx = (h) => h * CELL_HEIGHT + (h - 1) * CELL_MARGIN;
|
|
486
|
+
var gridOffsetPx = (y) => y * (CELL_HEIGHT + CELL_MARGIN);
|
|
487
|
+
var overlaps = (a, b) => a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
|
|
488
|
+
function compactGrid(boxes, fixed2 = /* @__PURE__ */ new Set()) {
|
|
489
|
+
const snapped = boxes.map((b) => {
|
|
490
|
+
const w = Math.min(GRID_COLUMNS, Math.max(1, Math.round(b.x + b.w) - Math.round(b.x)));
|
|
491
|
+
const x = Math.min(GRID_COLUMNS - w, Math.max(0, Math.round(b.x)));
|
|
492
|
+
return { x, y: Math.max(0, b.y), w, h: Math.max(1, Math.round(b.h)) };
|
|
493
|
+
});
|
|
494
|
+
const out = new Array(boxes.length);
|
|
495
|
+
const placed = [];
|
|
496
|
+
for (const i of fixed2) {
|
|
497
|
+
if (!snapped[i]) continue;
|
|
498
|
+
out[i] = { ...snapped[i], y: Math.round(snapped[i].y) };
|
|
499
|
+
placed.push(out[i]);
|
|
500
|
+
}
|
|
501
|
+
const order = snapped.map((_, i) => i).filter((i) => !fixed2.has(i)).sort((a, b) => snapped[a].y - snapped[b].y || snapped[a].x - snapped[b].x || a - b);
|
|
502
|
+
for (const i of order) {
|
|
503
|
+
const box = { ...snapped[i], y: Math.floor(snapped[i].y) };
|
|
504
|
+
box.y = Math.min(box.y, Math.max(0, ...placed.map((p) => p.y + p.h)));
|
|
505
|
+
while (box.y > 0 && !placed.some((p) => overlaps({ ...box, y: box.y - 1 }, p))) box.y--;
|
|
506
|
+
for (let hit = placed.find((p) => overlaps(box, p)); hit; hit = placed.find((p) => overlaps(box, p))) box.y = hit.y + hit.h;
|
|
507
|
+
out[i] = box;
|
|
508
|
+
placed.push(box);
|
|
509
|
+
}
|
|
510
|
+
return out;
|
|
511
|
+
}
|
|
486
512
|
var isRow = (p) => p.type === "row";
|
|
487
513
|
var byPosition = (a, b) => a.gridPos.y - b.gridPos.y || a.gridPos.x - b.gridPos.x;
|
|
488
514
|
function layoutDashboard(dashboard, mode = "phone", repeat2) {
|
|
@@ -506,12 +532,15 @@ function layoutDashboard(dashboard, mode = "phone", repeat2) {
|
|
|
506
532
|
children: s.children.map((c) => ({ ...c, scopedVars: { ...c.scopedVars, ...scoped } }))
|
|
507
533
|
};
|
|
508
534
|
});
|
|
509
|
-
}).map((s) =>
|
|
510
|
-
|
|
511
|
-
row: s.row,
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
535
|
+
}).map((s) => {
|
|
536
|
+
const panels = expandPanelRepeats(s.children, repeat2).sort(byPosition);
|
|
537
|
+
return { key: s.key, row: s.row, collapsed: !!_optionalChain([s, 'access', _51 => _51.row, 'optionalAccess', _52 => _52.collapsed]), rows: packRows(panels, mode), grid: placeOnGrid(panels) };
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
function placeOnGrid(panels) {
|
|
541
|
+
const boxes = compactGrid(panels.map((p) => p.gridPos));
|
|
542
|
+
const cells = panels.map((panel, i) => ({ key: panelKey(panel), panel, span: boxes[i].w, ...boxes[i] }));
|
|
543
|
+
return { cells, h: Math.max(0, ...boxes.map((b) => b.y + b.h)) };
|
|
515
544
|
}
|
|
516
545
|
function repeatOptions(name, ctx) {
|
|
517
546
|
const value = ctx.values[name];
|
|
@@ -8318,12 +8347,12 @@ function documentUses(manifest) {
|
|
|
8318
8347
|
// node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
8319
8348
|
function createScanner(text, ignoreTrivia = false) {
|
|
8320
8349
|
const len = text.length;
|
|
8321
|
-
let
|
|
8350
|
+
let pos3 = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
|
|
8322
8351
|
function scanHexDigits(count, exact) {
|
|
8323
8352
|
let digits = 0;
|
|
8324
8353
|
let value2 = 0;
|
|
8325
8354
|
while (digits < count || !exact) {
|
|
8326
|
-
let ch = text.charCodeAt(
|
|
8355
|
+
let ch = text.charCodeAt(pos3);
|
|
8327
8356
|
if (ch >= 48 && ch <= 57) {
|
|
8328
8357
|
value2 = value2 * 16 + ch - 48;
|
|
8329
8358
|
} else if (ch >= 65 && ch <= 70) {
|
|
@@ -8333,7 +8362,7 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
8333
8362
|
} else {
|
|
8334
8363
|
break;
|
|
8335
8364
|
}
|
|
8336
|
-
|
|
8365
|
+
pos3++;
|
|
8337
8366
|
digits++;
|
|
8338
8367
|
}
|
|
8339
8368
|
if (digits < count) {
|
|
@@ -8342,46 +8371,46 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
8342
8371
|
return value2;
|
|
8343
8372
|
}
|
|
8344
8373
|
function setPosition(newPosition) {
|
|
8345
|
-
|
|
8374
|
+
pos3 = newPosition;
|
|
8346
8375
|
value = "";
|
|
8347
8376
|
tokenOffset = 0;
|
|
8348
8377
|
token = 16;
|
|
8349
8378
|
scanError = 0;
|
|
8350
8379
|
}
|
|
8351
8380
|
function scanNumber() {
|
|
8352
|
-
let start =
|
|
8353
|
-
if (text.charCodeAt(
|
|
8354
|
-
|
|
8381
|
+
let start = pos3;
|
|
8382
|
+
if (text.charCodeAt(pos3) === 48) {
|
|
8383
|
+
pos3++;
|
|
8355
8384
|
} else {
|
|
8356
|
-
|
|
8357
|
-
while (
|
|
8358
|
-
|
|
8385
|
+
pos3++;
|
|
8386
|
+
while (pos3 < text.length && isDigit(text.charCodeAt(pos3))) {
|
|
8387
|
+
pos3++;
|
|
8359
8388
|
}
|
|
8360
8389
|
}
|
|
8361
|
-
if (
|
|
8362
|
-
|
|
8363
|
-
if (
|
|
8364
|
-
|
|
8365
|
-
while (
|
|
8366
|
-
|
|
8390
|
+
if (pos3 < text.length && text.charCodeAt(pos3) === 46) {
|
|
8391
|
+
pos3++;
|
|
8392
|
+
if (pos3 < text.length && isDigit(text.charCodeAt(pos3))) {
|
|
8393
|
+
pos3++;
|
|
8394
|
+
while (pos3 < text.length && isDigit(text.charCodeAt(pos3))) {
|
|
8395
|
+
pos3++;
|
|
8367
8396
|
}
|
|
8368
8397
|
} else {
|
|
8369
8398
|
scanError = 3;
|
|
8370
|
-
return text.substring(start,
|
|
8399
|
+
return text.substring(start, pos3);
|
|
8371
8400
|
}
|
|
8372
8401
|
}
|
|
8373
|
-
let end =
|
|
8374
|
-
if (
|
|
8375
|
-
|
|
8376
|
-
if (
|
|
8377
|
-
|
|
8402
|
+
let end = pos3;
|
|
8403
|
+
if (pos3 < text.length && (text.charCodeAt(pos3) === 69 || text.charCodeAt(pos3) === 101)) {
|
|
8404
|
+
pos3++;
|
|
8405
|
+
if (pos3 < text.length && text.charCodeAt(pos3) === 43 || text.charCodeAt(pos3) === 45) {
|
|
8406
|
+
pos3++;
|
|
8378
8407
|
}
|
|
8379
|
-
if (
|
|
8380
|
-
|
|
8381
|
-
while (
|
|
8382
|
-
|
|
8408
|
+
if (pos3 < text.length && isDigit(text.charCodeAt(pos3))) {
|
|
8409
|
+
pos3++;
|
|
8410
|
+
while (pos3 < text.length && isDigit(text.charCodeAt(pos3))) {
|
|
8411
|
+
pos3++;
|
|
8383
8412
|
}
|
|
8384
|
-
end =
|
|
8413
|
+
end = pos3;
|
|
8385
8414
|
} else {
|
|
8386
8415
|
scanError = 3;
|
|
8387
8416
|
}
|
|
@@ -8389,27 +8418,27 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
8389
8418
|
return text.substring(start, end);
|
|
8390
8419
|
}
|
|
8391
8420
|
function scanString() {
|
|
8392
|
-
let result = "", start =
|
|
8421
|
+
let result = "", start = pos3;
|
|
8393
8422
|
while (true) {
|
|
8394
|
-
if (
|
|
8395
|
-
result += text.substring(start,
|
|
8423
|
+
if (pos3 >= len) {
|
|
8424
|
+
result += text.substring(start, pos3);
|
|
8396
8425
|
scanError = 2;
|
|
8397
8426
|
break;
|
|
8398
8427
|
}
|
|
8399
|
-
const ch = text.charCodeAt(
|
|
8428
|
+
const ch = text.charCodeAt(pos3);
|
|
8400
8429
|
if (ch === 34) {
|
|
8401
|
-
result += text.substring(start,
|
|
8402
|
-
|
|
8430
|
+
result += text.substring(start, pos3);
|
|
8431
|
+
pos3++;
|
|
8403
8432
|
break;
|
|
8404
8433
|
}
|
|
8405
8434
|
if (ch === 92) {
|
|
8406
|
-
result += text.substring(start,
|
|
8407
|
-
|
|
8408
|
-
if (
|
|
8435
|
+
result += text.substring(start, pos3);
|
|
8436
|
+
pos3++;
|
|
8437
|
+
if (pos3 >= len) {
|
|
8409
8438
|
scanError = 2;
|
|
8410
8439
|
break;
|
|
8411
8440
|
}
|
|
8412
|
-
const ch2 = text.charCodeAt(
|
|
8441
|
+
const ch2 = text.charCodeAt(pos3++);
|
|
8413
8442
|
switch (ch2) {
|
|
8414
8443
|
case 34:
|
|
8415
8444
|
result += '"';
|
|
@@ -8446,126 +8475,126 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
8446
8475
|
default:
|
|
8447
8476
|
scanError = 5;
|
|
8448
8477
|
}
|
|
8449
|
-
start =
|
|
8478
|
+
start = pos3;
|
|
8450
8479
|
continue;
|
|
8451
8480
|
}
|
|
8452
8481
|
if (ch >= 0 && ch <= 31) {
|
|
8453
8482
|
if (isLineBreak(ch)) {
|
|
8454
|
-
result += text.substring(start,
|
|
8483
|
+
result += text.substring(start, pos3);
|
|
8455
8484
|
scanError = 2;
|
|
8456
8485
|
break;
|
|
8457
8486
|
} else {
|
|
8458
8487
|
scanError = 6;
|
|
8459
8488
|
}
|
|
8460
8489
|
}
|
|
8461
|
-
|
|
8490
|
+
pos3++;
|
|
8462
8491
|
}
|
|
8463
8492
|
return result;
|
|
8464
8493
|
}
|
|
8465
8494
|
function scanNext() {
|
|
8466
8495
|
value = "";
|
|
8467
8496
|
scanError = 0;
|
|
8468
|
-
tokenOffset =
|
|
8497
|
+
tokenOffset = pos3;
|
|
8469
8498
|
lineStartOffset = lineNumber;
|
|
8470
8499
|
prevTokenLineStartOffset = tokenLineStartOffset;
|
|
8471
|
-
if (
|
|
8500
|
+
if (pos3 >= len) {
|
|
8472
8501
|
tokenOffset = len;
|
|
8473
8502
|
return token = 17;
|
|
8474
8503
|
}
|
|
8475
|
-
let code = text.charCodeAt(
|
|
8504
|
+
let code = text.charCodeAt(pos3);
|
|
8476
8505
|
if (isWhiteSpace(code)) {
|
|
8477
8506
|
do {
|
|
8478
|
-
|
|
8507
|
+
pos3++;
|
|
8479
8508
|
value += String.fromCharCode(code);
|
|
8480
|
-
code = text.charCodeAt(
|
|
8509
|
+
code = text.charCodeAt(pos3);
|
|
8481
8510
|
} while (isWhiteSpace(code));
|
|
8482
8511
|
return token = 15;
|
|
8483
8512
|
}
|
|
8484
8513
|
if (isLineBreak(code)) {
|
|
8485
|
-
|
|
8514
|
+
pos3++;
|
|
8486
8515
|
value += String.fromCharCode(code);
|
|
8487
|
-
if (code === 13 && text.charCodeAt(
|
|
8488
|
-
|
|
8516
|
+
if (code === 13 && text.charCodeAt(pos3) === 10) {
|
|
8517
|
+
pos3++;
|
|
8489
8518
|
value += "\n";
|
|
8490
8519
|
}
|
|
8491
8520
|
lineNumber++;
|
|
8492
|
-
tokenLineStartOffset =
|
|
8521
|
+
tokenLineStartOffset = pos3;
|
|
8493
8522
|
return token = 14;
|
|
8494
8523
|
}
|
|
8495
8524
|
switch (code) {
|
|
8496
8525
|
// tokens: []{}:,
|
|
8497
8526
|
case 123:
|
|
8498
|
-
|
|
8527
|
+
pos3++;
|
|
8499
8528
|
return token = 1;
|
|
8500
8529
|
case 125:
|
|
8501
|
-
|
|
8530
|
+
pos3++;
|
|
8502
8531
|
return token = 2;
|
|
8503
8532
|
case 91:
|
|
8504
|
-
|
|
8533
|
+
pos3++;
|
|
8505
8534
|
return token = 3;
|
|
8506
8535
|
case 93:
|
|
8507
|
-
|
|
8536
|
+
pos3++;
|
|
8508
8537
|
return token = 4;
|
|
8509
8538
|
case 58:
|
|
8510
|
-
|
|
8539
|
+
pos3++;
|
|
8511
8540
|
return token = 6;
|
|
8512
8541
|
case 44:
|
|
8513
|
-
|
|
8542
|
+
pos3++;
|
|
8514
8543
|
return token = 5;
|
|
8515
8544
|
// strings
|
|
8516
8545
|
case 34:
|
|
8517
|
-
|
|
8546
|
+
pos3++;
|
|
8518
8547
|
value = scanString();
|
|
8519
8548
|
return token = 10;
|
|
8520
8549
|
// comments
|
|
8521
8550
|
case 47:
|
|
8522
|
-
const start =
|
|
8523
|
-
if (text.charCodeAt(
|
|
8524
|
-
|
|
8525
|
-
while (
|
|
8526
|
-
if (isLineBreak(text.charCodeAt(
|
|
8551
|
+
const start = pos3 - 1;
|
|
8552
|
+
if (text.charCodeAt(pos3 + 1) === 47) {
|
|
8553
|
+
pos3 += 2;
|
|
8554
|
+
while (pos3 < len) {
|
|
8555
|
+
if (isLineBreak(text.charCodeAt(pos3))) {
|
|
8527
8556
|
break;
|
|
8528
8557
|
}
|
|
8529
|
-
|
|
8558
|
+
pos3++;
|
|
8530
8559
|
}
|
|
8531
|
-
value = text.substring(start,
|
|
8560
|
+
value = text.substring(start, pos3);
|
|
8532
8561
|
return token = 12;
|
|
8533
8562
|
}
|
|
8534
|
-
if (text.charCodeAt(
|
|
8535
|
-
|
|
8563
|
+
if (text.charCodeAt(pos3 + 1) === 42) {
|
|
8564
|
+
pos3 += 2;
|
|
8536
8565
|
const safeLength = len - 1;
|
|
8537
8566
|
let commentClosed = false;
|
|
8538
|
-
while (
|
|
8539
|
-
const ch = text.charCodeAt(
|
|
8540
|
-
if (ch === 42 && text.charCodeAt(
|
|
8541
|
-
|
|
8567
|
+
while (pos3 < safeLength) {
|
|
8568
|
+
const ch = text.charCodeAt(pos3);
|
|
8569
|
+
if (ch === 42 && text.charCodeAt(pos3 + 1) === 47) {
|
|
8570
|
+
pos3 += 2;
|
|
8542
8571
|
commentClosed = true;
|
|
8543
8572
|
break;
|
|
8544
8573
|
}
|
|
8545
|
-
|
|
8574
|
+
pos3++;
|
|
8546
8575
|
if (isLineBreak(ch)) {
|
|
8547
|
-
if (ch === 13 && text.charCodeAt(
|
|
8548
|
-
|
|
8576
|
+
if (ch === 13 && text.charCodeAt(pos3) === 10) {
|
|
8577
|
+
pos3++;
|
|
8549
8578
|
}
|
|
8550
8579
|
lineNumber++;
|
|
8551
|
-
tokenLineStartOffset =
|
|
8580
|
+
tokenLineStartOffset = pos3;
|
|
8552
8581
|
}
|
|
8553
8582
|
}
|
|
8554
8583
|
if (!commentClosed) {
|
|
8555
|
-
|
|
8584
|
+
pos3++;
|
|
8556
8585
|
scanError = 1;
|
|
8557
8586
|
}
|
|
8558
|
-
value = text.substring(start,
|
|
8587
|
+
value = text.substring(start, pos3);
|
|
8559
8588
|
return token = 13;
|
|
8560
8589
|
}
|
|
8561
8590
|
value += String.fromCharCode(code);
|
|
8562
|
-
|
|
8591
|
+
pos3++;
|
|
8563
8592
|
return token = 16;
|
|
8564
8593
|
// numbers
|
|
8565
8594
|
case 45:
|
|
8566
8595
|
value += String.fromCharCode(code);
|
|
8567
|
-
|
|
8568
|
-
if (
|
|
8596
|
+
pos3++;
|
|
8597
|
+
if (pos3 === len || !isDigit(text.charCodeAt(pos3))) {
|
|
8569
8598
|
return token = 16;
|
|
8570
8599
|
}
|
|
8571
8600
|
// found a minus, followed by a number so
|
|
@@ -8585,12 +8614,12 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
8585
8614
|
return token = 11;
|
|
8586
8615
|
// literals and unknown symbols
|
|
8587
8616
|
default:
|
|
8588
|
-
while (
|
|
8589
|
-
|
|
8590
|
-
code = text.charCodeAt(
|
|
8617
|
+
while (pos3 < len && isUnknownContentCharacter(code)) {
|
|
8618
|
+
pos3++;
|
|
8619
|
+
code = text.charCodeAt(pos3);
|
|
8591
8620
|
}
|
|
8592
|
-
if (tokenOffset !==
|
|
8593
|
-
value = text.substring(tokenOffset,
|
|
8621
|
+
if (tokenOffset !== pos3) {
|
|
8622
|
+
value = text.substring(tokenOffset, pos3);
|
|
8594
8623
|
switch (value) {
|
|
8595
8624
|
case "true":
|
|
8596
8625
|
return token = 8;
|
|
@@ -8602,7 +8631,7 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
8602
8631
|
return token = 16;
|
|
8603
8632
|
}
|
|
8604
8633
|
value += String.fromCharCode(code);
|
|
8605
|
-
|
|
8634
|
+
pos3++;
|
|
8606
8635
|
return token = 16;
|
|
8607
8636
|
}
|
|
8608
8637
|
}
|
|
@@ -8632,12 +8661,12 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
8632
8661
|
}
|
|
8633
8662
|
return {
|
|
8634
8663
|
setPosition,
|
|
8635
|
-
getPosition: () =>
|
|
8664
|
+
getPosition: () => pos3,
|
|
8636
8665
|
scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
|
|
8637
8666
|
getToken: () => token,
|
|
8638
8667
|
getTokenValue: () => value,
|
|
8639
8668
|
getTokenOffset: () => tokenOffset,
|
|
8640
|
-
getTokenLength: () =>
|
|
8669
|
+
getTokenLength: () => pos3 - tokenOffset,
|
|
8641
8670
|
getTokenStartLine: () => lineStartOffset,
|
|
8642
8671
|
getTokenStartCharacter: () => tokenOffset - prevTokenLineStartOffset,
|
|
8643
8672
|
getTokenError: () => scanError
|
|
@@ -10306,6 +10335,33 @@ function panelSize(panel, mode) {
|
|
|
10306
10335
|
return { span: panelSpan(panel, "phone"), h: clampH(_nullishCoalesce(_optionalChain([panel, 'access', _286 => _286.mobile, 'optionalAccess', _287 => _287.h]), () => ( p.h))) };
|
|
10307
10336
|
}
|
|
10308
10337
|
function layoutCanvas(panels, order, mode, width, override) {
|
|
10338
|
+
return mode === "grid" ? layoutGridCanvas(panels, width, override) : layoutPhoneCanvas(panels, order, width, override);
|
|
10339
|
+
}
|
|
10340
|
+
function layoutGridCanvas(panels, width, override) {
|
|
10341
|
+
const colW = (width + CANVAS_GAP) / GRID_COLUMNS;
|
|
10342
|
+
let boxes = gridBoxes(panels);
|
|
10343
|
+
if (override && boxes[override.index]) {
|
|
10344
|
+
const b = { ...boxes[override.index] };
|
|
10345
|
+
if (!isRow(panels[override.index])) {
|
|
10346
|
+
if (override.span !== void 0) b.w = clampW(override.span);
|
|
10347
|
+
if (override.h !== void 0) b.h = clampH(override.h);
|
|
10348
|
+
}
|
|
10349
|
+
if (override.x !== void 0) b.x = isRow(panels[override.index]) ? 0 : Math.min(GRID_COLUMNS - b.w, Math.max(0, Math.round(override.x)));
|
|
10350
|
+
if (override.y !== void 0) b.y = Math.max(0, Math.round(override.y));
|
|
10351
|
+
b.x = Math.min(b.x, GRID_COLUMNS - b.w);
|
|
10352
|
+
boxes = [...boxes];
|
|
10353
|
+
boxes[override.index] = b;
|
|
10354
|
+
}
|
|
10355
|
+
const settled = settleBoxes(boxes, _optionalChain([override, 'optionalAccess', _288 => _288.index]));
|
|
10356
|
+
const items = settled.map((b, index) => {
|
|
10357
|
+
const row = isRow(panels[index]);
|
|
10358
|
+
return { index, row, x: b.x * colW, y: gridOffsetPx(b.y), width: b.w * colW - CANVAS_GAP, height: row ? gridUnitsToPx(1) : gridUnitsToPx(b.h), span: b.w, h: b.h };
|
|
10359
|
+
});
|
|
10360
|
+
items.sort((a, b) => a.y - b.y || a.x - b.x);
|
|
10361
|
+
return { items, height: Math.max(0, ...items.map((c) => c.y + c.height)), hidden: [] };
|
|
10362
|
+
}
|
|
10363
|
+
function layoutPhoneCanvas(panels, order, width, override) {
|
|
10364
|
+
const mode = "phone";
|
|
10309
10365
|
const colW = (width + CANVAS_GAP) / GRID_COLUMNS;
|
|
10310
10366
|
const items = [];
|
|
10311
10367
|
const hidden = [];
|
|
@@ -10340,11 +10396,12 @@ function layoutCanvas(panels, order, mode, width, override) {
|
|
|
10340
10396
|
y += CANVAS_ROW_HEADER + CANVAS_GAP;
|
|
10341
10397
|
continue;
|
|
10342
10398
|
}
|
|
10343
|
-
if (mode === "phone" && _optionalChain([panel, 'access',
|
|
10399
|
+
if (mode === "phone" && _optionalChain([panel, 'access', _289 => _289.mobile, 'optionalAccess', _290 => _290.hidden])) {
|
|
10344
10400
|
hidden.push(index);
|
|
10345
10401
|
continue;
|
|
10346
10402
|
}
|
|
10347
|
-
const
|
|
10403
|
+
const natural = panelSize(panel, mode);
|
|
10404
|
+
const size = _optionalChain([override, 'optionalAccess', _291 => _291.index]) === index ? { span: clampW(_nullishCoalesce(override.span, () => ( natural.span))), h: clampH(_nullishCoalesce(override.h, () => ( natural.h))) } : natural;
|
|
10348
10405
|
if (used + size.span > GRID_COLUMNS) flush();
|
|
10349
10406
|
line.push({ index, row: false, x: 0, y: 0, width: 0, height: 0, ...size });
|
|
10350
10407
|
used += size.span;
|
|
@@ -10362,19 +10419,24 @@ function dropTarget(canvas, x, y, dragging) {
|
|
|
10362
10419
|
for (const c of pool) if (distance(c) < distance(best)) best = c;
|
|
10363
10420
|
const after = best.row ? y > best.y + best.height / 2 : x > best.x + best.width / 2;
|
|
10364
10421
|
if (!after) return best.index;
|
|
10365
|
-
return _nullishCoalesce(_optionalChain([items, 'access',
|
|
10422
|
+
return _nullishCoalesce(_optionalChain([items, 'access', _292 => _292[items.indexOf(best) + 1], 'optionalAccess', _293 => _293.index]), () => ( null));
|
|
10366
10423
|
}
|
|
10367
10424
|
function movePanel(panels, index, before) {
|
|
10368
|
-
|
|
10369
|
-
const
|
|
10370
|
-
|
|
10371
|
-
return
|
|
10425
|
+
if (before === index) return panels;
|
|
10426
|
+
const others = panels.filter((_, i) => i !== index);
|
|
10427
|
+
const at = before === null || !panels[before] ? { x: 0, y: bottom(others) } : pos(panels[before]);
|
|
10428
|
+
return placePanel(panels, index, at.x, at.y);
|
|
10372
10429
|
}
|
|
10373
10430
|
function resizePanel(panels, index, mode, span, h) {
|
|
10374
10431
|
const out = [...panels];
|
|
10375
10432
|
const p = panels[index];
|
|
10376
|
-
|
|
10377
|
-
|
|
10433
|
+
if (mode === "phone") {
|
|
10434
|
+
out[index] = { ...p, mobile: { ...p.mobile, span: clampW(span), h: clampH(h) } };
|
|
10435
|
+
return out;
|
|
10436
|
+
}
|
|
10437
|
+
const w = clampW(span);
|
|
10438
|
+
out[index] = { ...p, gridPos: { ...pos(p), x: Math.min(pos(p).x, GRID_COLUMNS - w), w, h: clampH(h) } };
|
|
10439
|
+
return settleLayout(out, index);
|
|
10378
10440
|
}
|
|
10379
10441
|
function setHiddenOnPhones(panels, index, hidden) {
|
|
10380
10442
|
const out = [...panels];
|
|
@@ -10389,34 +10451,78 @@ function nextPanelId(panels) {
|
|
|
10389
10451
|
}
|
|
10390
10452
|
function insertPanel(panels, panel, after) {
|
|
10391
10453
|
const index = panels.length;
|
|
10392
|
-
const
|
|
10393
|
-
const
|
|
10394
|
-
|
|
10395
|
-
|
|
10454
|
+
const p = { ...DEFAULT_POS, ...panel.gridPos };
|
|
10455
|
+
const w = isRow(panel) ? GRID_COLUMNS : clampW(p.w);
|
|
10456
|
+
let at;
|
|
10457
|
+
if (after === null || !panels[after]) at = { x: 0, y: bottom(panels) };
|
|
10458
|
+
else {
|
|
10459
|
+
const a = pos(panels[after]);
|
|
10460
|
+
at = !isRow(panel) && !isRow(panels[after]) && a.x + a.w + w <= GRID_COLUMNS ? { x: a.x + a.w, y: a.y } : { x: isRow(panel) ? 0 : Math.min(a.x, GRID_COLUMNS - w), y: a.y + a.h };
|
|
10461
|
+
}
|
|
10462
|
+
const out = [...panels, { ...panel, id: nextPanelId(panels), gridPos: { ...p, ...at, w } }];
|
|
10463
|
+
return { panels: settleLayout(out, index), index };
|
|
10396
10464
|
}
|
|
10397
10465
|
function duplicatePanel(panels, index) {
|
|
10398
10466
|
return insertPanel(panels, structuredClone(panels[index]), index);
|
|
10399
10467
|
}
|
|
10400
10468
|
function removePanel(panels, index) {
|
|
10401
|
-
|
|
10402
|
-
return repack(out, readingOrder(out));
|
|
10469
|
+
return settleLayout(panels.filter((_, i) => i !== index));
|
|
10403
10470
|
}
|
|
10404
10471
|
function expandRow(panels, index) {
|
|
10405
10472
|
const row = panels[index];
|
|
10406
10473
|
const children = _nullishCoalesce(row.panels, () => ( []));
|
|
10407
|
-
const
|
|
10474
|
+
const top = pos(row).y + 1;
|
|
10475
|
+
const first = Math.min(...children.map((c) => pos(c).y));
|
|
10476
|
+
const height = Math.max(0, ...children.map((c) => pos(c).y - first + pos(c).h));
|
|
10477
|
+
const out = panels.map((p, i) => i !== index && pos(p).y > pos(row).y ? { ...p, gridPos: { ...pos(p), y: pos(p).y + height } } : p);
|
|
10408
10478
|
out[index] = { ...row, collapsed: false, panels: [] };
|
|
10479
|
+
out.push(...children.map((c) => ({ ...c, gridPos: { ...pos(c), y: top + pos(c).y - first } })));
|
|
10480
|
+
return settleLayout(out);
|
|
10481
|
+
}
|
|
10482
|
+
function collapseRow(panels, index) {
|
|
10409
10483
|
const order = readingOrder(panels);
|
|
10410
|
-
order.
|
|
10411
|
-
|
|
10484
|
+
const at = order.indexOf(index);
|
|
10485
|
+
const next = order.findIndex((i, n) => n > at && isRow(panels[i]));
|
|
10486
|
+
const removed = order.slice(at + 1, next === -1 ? order.length : next).sort((a, b) => a - b);
|
|
10487
|
+
const out = panels.filter((_, i) => !removed.includes(i));
|
|
10488
|
+
const rowAt = index - removed.filter((i) => i < index).length;
|
|
10489
|
+
out[rowAt] = { ...panels[index], collapsed: true, panels: removed.map((i) => panels[i]) };
|
|
10490
|
+
return { panels: settleLayout(out), removed };
|
|
10491
|
+
}
|
|
10492
|
+
var bottom = (panels) => Math.max(0, ...panels.map((p) => pos(p).y + pos(p).h));
|
|
10493
|
+
var gridBoxes = (panels) => panels.map((p) => isRow(p) ? { ...pos(p), x: 0, w: GRID_COLUMNS, h: 1 } : pos(p));
|
|
10494
|
+
function settleBoxes(boxes, fixed2) {
|
|
10495
|
+
const keep = new Set(fixed2 === void 0 ? [] : [fixed2].flat());
|
|
10496
|
+
const made = keep.size ? compactGrid(boxes, keep) : boxes;
|
|
10497
|
+
return compactGrid(made);
|
|
10498
|
+
}
|
|
10499
|
+
function writeBoxes(panels, boxes) {
|
|
10500
|
+
return panels.map((p, i) => {
|
|
10501
|
+
const before = p.gridPos;
|
|
10502
|
+
const b = boxes[i];
|
|
10503
|
+
return before && before.x === b.x && before.y === b.y && before.w === b.w && before.h === b.h ? p : { ...p, gridPos: { ...pos(p), ...b } };
|
|
10504
|
+
});
|
|
10505
|
+
}
|
|
10506
|
+
function settleLayout(panels, fixed2) {
|
|
10507
|
+
return writeBoxes(panels, settleBoxes(gridBoxes(panels), fixed2));
|
|
10508
|
+
}
|
|
10509
|
+
function placePanel(panels, index, x, y) {
|
|
10510
|
+
const out = [...panels];
|
|
10511
|
+
const p = pos(panels[index]);
|
|
10512
|
+
const w = isRow(panels[index]) ? GRID_COLUMNS : clampW(p.w);
|
|
10513
|
+
out[index] = { ...panels[index], gridPos: { ...p, x: Math.min(GRID_COLUMNS - w, Math.max(0, Math.round(x))), y: Math.max(0, Math.round(y)) } };
|
|
10514
|
+
return settleLayout(out, index);
|
|
10515
|
+
}
|
|
10516
|
+
function snapToGrid(width, x, y, w) {
|
|
10517
|
+
const colW = (width + CANVAS_GAP) / GRID_COLUMNS;
|
|
10518
|
+
return { x: Math.min(GRID_COLUMNS - w, Math.max(0, Math.round(x / colW))), y: Math.max(0, Math.round(y / gridOffsetPx(1))) };
|
|
10412
10519
|
}
|
|
10413
10520
|
function panelEdits(before, after, removed) {
|
|
10414
10521
|
const edits = [];
|
|
10415
10522
|
let base = before;
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
}
|
|
10523
|
+
const gone = [...new Set(removed === void 0 ? [] : [removed].flat())].sort((a, b) => b - a);
|
|
10524
|
+
for (const i of gone) edits.push({ path: ["panels", i], remove: true });
|
|
10525
|
+
if (gone.length) base = before.filter((_, i) => !gone.includes(i));
|
|
10420
10526
|
base.forEach((p, i) => edits.push(...diffJson(p, after[i], ["panels", i])));
|
|
10421
10527
|
for (let i = base.length; i < after.length; i++) edits.push({ path: ["panels", i], value: after[i], insert: true });
|
|
10422
10528
|
return edits;
|
|
@@ -10496,6 +10602,181 @@ function sampleEntries(forms, metrics, now = Date.now(), days = 180) {
|
|
|
10496
10602
|
return out;
|
|
10497
10603
|
}
|
|
10498
10604
|
|
|
10605
|
+
// src/core/snippets.ts
|
|
10606
|
+
var SNIPPET_VERSION = 1;
|
|
10607
|
+
var DEFAULT_POS2 = { x: 0, y: 0, w: GRID_COLUMNS, h: 4 };
|
|
10608
|
+
var pos2 = (p) => ({ ...DEFAULT_POS2, ...p.gridPos });
|
|
10609
|
+
var isObject4 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
10610
|
+
var refers2 = (name) => new RegExp(`\\$${name}\\b|\\$\\{${name}(:\\w+)?\\}|\\[\\[${name}(:\\w+)?\\]\\]`);
|
|
10611
|
+
var withChildren = (p) => [p, ...isRow(p) ? _nullishCoalesce(p.panels, () => ( [])) : []];
|
|
10612
|
+
function panelMetrics(p) {
|
|
10613
|
+
const found = [];
|
|
10614
|
+
if (isInputType(p.type) && typeof _optionalChain([p, 'access', _294 => _294.options, 'optionalAccess', _295 => _295.metric]) === "string") found.push(p.options.metric);
|
|
10615
|
+
for (const t of _nullishCoalesce(p.targets, () => ( []))) if (typeof t.metric === "string" && t.metric && !t.metric.startsWith("$")) found.push(t.metric);
|
|
10616
|
+
return found;
|
|
10617
|
+
}
|
|
10618
|
+
function renameMetrics(panels, map) {
|
|
10619
|
+
const rename = (p) => {
|
|
10620
|
+
let out = p;
|
|
10621
|
+
if (isInputType(p.type) && typeof _optionalChain([p, 'access', _296 => _296.options, 'optionalAccess', _297 => _297.metric]) === "string" && map[p.options.metric]) out = { ...out, options: { ...out.options, metric: map[p.options.metric] } };
|
|
10622
|
+
if (_optionalChain([p, 'access', _298 => _298.targets, 'optionalAccess', _299 => _299.some, 'call', _300 => _300((t) => typeof t.metric === "string" && map[t.metric])])) out = { ...out, targets: p.targets.map((t) => typeof t.metric === "string" && map[t.metric] ? { ...t, metric: map[t.metric] } : t) };
|
|
10623
|
+
if (_optionalChain([p, 'access', _301 => _301.panels, 'optionalAccess', _302 => _302.length])) out = { ...out, panels: p.panels.map(rename) };
|
|
10624
|
+
return out;
|
|
10625
|
+
};
|
|
10626
|
+
return panels.map(rename);
|
|
10627
|
+
}
|
|
10628
|
+
function copyPanels(dashboard, indices) {
|
|
10629
|
+
const panels = _nullishCoalesce(dashboard.panels, () => ( []));
|
|
10630
|
+
const order = readingOrder(panels);
|
|
10631
|
+
const picked = /* @__PURE__ */ new Set();
|
|
10632
|
+
for (const i of indices) {
|
|
10633
|
+
if (!panels[i]) continue;
|
|
10634
|
+
picked.add(i);
|
|
10635
|
+
if (isRow(panels[i]) && !panels[i].collapsed) {
|
|
10636
|
+
for (const j of order.slice(order.indexOf(i) + 1)) {
|
|
10637
|
+
if (isRow(panels[j])) break;
|
|
10638
|
+
picked.add(j);
|
|
10639
|
+
}
|
|
10640
|
+
}
|
|
10641
|
+
}
|
|
10642
|
+
const chosen = order.filter((i) => picked.has(i)).map((i) => panels[i]);
|
|
10643
|
+
return snippetOf(chosen, _nullishCoalesce(_optionalChain([dashboard, 'access', _303 => _303.templating, 'optionalAccess', _304 => _304.list]), () => ( [])));
|
|
10644
|
+
}
|
|
10645
|
+
function snippetOf(panels, available) {
|
|
10646
|
+
const left = Math.min(...panels.map((p) => pos2(p).x));
|
|
10647
|
+
const top = Math.min(...panels.map((p) => pos2(p).y));
|
|
10648
|
+
const shift = (p) => {
|
|
10649
|
+
const { id: _, ...rest } = p;
|
|
10650
|
+
const g = pos2(p);
|
|
10651
|
+
return { ...rest, gridPos: { ...g, x: g.x - (isRow(p) ? 0 : left), y: g.y - top }, ...p.panels && { panels: p.panels.map(shift) } };
|
|
10652
|
+
};
|
|
10653
|
+
const out = panels.map(shift);
|
|
10654
|
+
const text = JSON.stringify(panels);
|
|
10655
|
+
const names = available.map((v) => v.name);
|
|
10656
|
+
const used = new Set(names.filter((n) => panels.some((p) => withChildren(p).some((c) => c.repeat === n)) || refers2(n).test(text)));
|
|
10657
|
+
for (let grew = true; grew; ) {
|
|
10658
|
+
grew = false;
|
|
10659
|
+
for (const v of available) {
|
|
10660
|
+
if (!used.has(v.name)) continue;
|
|
10661
|
+
for (const r of variableReferences(v, names)) {
|
|
10662
|
+
if (used.has(r)) continue;
|
|
10663
|
+
used.add(r);
|
|
10664
|
+
grew = true;
|
|
10665
|
+
}
|
|
10666
|
+
}
|
|
10667
|
+
}
|
|
10668
|
+
const all = panels.flatMap(withChildren);
|
|
10669
|
+
return {
|
|
10670
|
+
$modelform: "panels",
|
|
10671
|
+
version: SNIPPET_VERSION,
|
|
10672
|
+
kind: all.some((p) => isInputType(p.type)) ? "form" : "dashboard",
|
|
10673
|
+
panels: out,
|
|
10674
|
+
variables: available.filter((v) => used.has(v.name)),
|
|
10675
|
+
metrics: [...new Set(all.flatMap(panelMetrics))]
|
|
10676
|
+
};
|
|
10677
|
+
}
|
|
10678
|
+
var looksLikePanel = (v) => isObject4(v) && typeof v.type === "string";
|
|
10679
|
+
function parseSnippet(text) {
|
|
10680
|
+
let json;
|
|
10681
|
+
try {
|
|
10682
|
+
json = JSON.parse(text);
|
|
10683
|
+
} catch (e19) {
|
|
10684
|
+
return { error: "That isn\u2019t JSON" };
|
|
10685
|
+
}
|
|
10686
|
+
let panels;
|
|
10687
|
+
let variables = [];
|
|
10688
|
+
if (isObject4(json) && json.$modelform === "panels") {
|
|
10689
|
+
if (typeof json.version !== "number" || json.version > SNIPPET_VERSION) return { error: "Those panels come from a newer version of modelform" };
|
|
10690
|
+
if (!Array.isArray(json.panels)) return { error: "The copied panels are missing their panels" };
|
|
10691
|
+
panels = json.panels;
|
|
10692
|
+
variables = Array.isArray(json.variables) ? json.variables : [];
|
|
10693
|
+
} else if (Array.isArray(json)) panels = json;
|
|
10694
|
+
else if (isObject4(json) && Array.isArray(json.panels) && !looksLikePanel(json)) {
|
|
10695
|
+
panels = json.panels;
|
|
10696
|
+
const templating = json.templating;
|
|
10697
|
+
variables = isObject4(templating) && Array.isArray(templating.list) ? templating.list : [];
|
|
10698
|
+
} else if (looksLikePanel(json)) panels = [json];
|
|
10699
|
+
else return { error: "That isn\u2019t a panel, a list of panels or a dashboard" };
|
|
10700
|
+
const usable = panels.filter(looksLikePanel);
|
|
10701
|
+
if (!usable.length) return { error: "There are no panels in it" };
|
|
10702
|
+
const vars = variables.filter((v) => isObject4(v) && typeof v.name === "string" && typeof v.type === "string");
|
|
10703
|
+
return { snippet: snippetOf(usable, vars) };
|
|
10704
|
+
}
|
|
10705
|
+
var stable = (v) => Array.isArray(v) ? `[${v.map(stable).join(",")}]` : isObject4(v) ? `{${Object.keys(v).sort().map((k) => `${JSON.stringify(k)}:${stable(v[k])}`).join(",")}}` : JSON.stringify(v);
|
|
10706
|
+
var sameVariable = (a, b) => {
|
|
10707
|
+
const strip = ({ current: _, options: __, ...rest }) => stable(rest);
|
|
10708
|
+
return strip(a) === strip(b);
|
|
10709
|
+
};
|
|
10710
|
+
function previewPaste(dashboard, snippet) {
|
|
10711
|
+
const { added, renamed } = mergeVariables(_nullishCoalesce(_optionalChain([dashboard, 'access', _305 => _305.templating, 'optionalAccess', _306 => _306.list]), () => ( [])), snippet.variables);
|
|
10712
|
+
return { added, renamed };
|
|
10713
|
+
}
|
|
10714
|
+
function mergeVariables(existing, incoming) {
|
|
10715
|
+
const taken = new Set(existing.map((v) => v.name));
|
|
10716
|
+
const added = [];
|
|
10717
|
+
const renamed = {};
|
|
10718
|
+
const out = [...existing];
|
|
10719
|
+
for (const v of incoming) {
|
|
10720
|
+
const same = existing.find((e) => e.name === v.name);
|
|
10721
|
+
if (same && sameVariable(same, v)) continue;
|
|
10722
|
+
let name = v.name;
|
|
10723
|
+
if (same) {
|
|
10724
|
+
let n = 2;
|
|
10725
|
+
while (taken.has(`${v.name}_${n}`)) n++;
|
|
10726
|
+
name = `${v.name}_${n}`;
|
|
10727
|
+
renamed[v.name] = name;
|
|
10728
|
+
}
|
|
10729
|
+
taken.add(name);
|
|
10730
|
+
added.push(name);
|
|
10731
|
+
out.push({ ...v, name });
|
|
10732
|
+
}
|
|
10733
|
+
const follow = (v) => Object.entries(renamed).reduce((acc, [from, to]) => renameVariableInPanels([acc], from, to)[0], v);
|
|
10734
|
+
return { variables: out.map((v, i) => i < existing.length ? v : follow(v)), added, renamed };
|
|
10735
|
+
}
|
|
10736
|
+
function pasteSnippet(dashboard, snippet, options = {}) {
|
|
10737
|
+
const existing = _nullishCoalesce(dashboard.panels, () => ( []));
|
|
10738
|
+
const kind = _nullishCoalesce(options.kind, () => ( (existing.flatMap(withChildren).some((p) => isInputType(p.type)) ? "form" : "dashboard")));
|
|
10739
|
+
const skipped = [];
|
|
10740
|
+
const keep = (p) => {
|
|
10741
|
+
if (kind === "dashboard" && isInputType(p.type)) {
|
|
10742
|
+
skipped.push(p.title || p.type);
|
|
10743
|
+
return false;
|
|
10744
|
+
}
|
|
10745
|
+
return true;
|
|
10746
|
+
};
|
|
10747
|
+
let incoming = snippet.panels.filter(keep).map((p) => p.panels ? { ...p, panels: p.panels.filter(keep) } : p);
|
|
10748
|
+
const { variables, added, renamed } = mergeVariables(_nullishCoalesce(_optionalChain([dashboard, 'access', _307 => _307.templating, 'optionalAccess', _308 => _308.list]), () => ( [])), snippet.variables);
|
|
10749
|
+
for (const [from, to] of Object.entries(renamed)) incoming = renameVariableInPanels(incoming, from, to);
|
|
10750
|
+
if (options.metrics) incoming = renameMetrics(incoming, options.metrics);
|
|
10751
|
+
const after = options.after != null ? existing[options.after] : void 0;
|
|
10752
|
+
const top = after ? pos2(after).y + pos2(after).h : Math.max(0, ...existing.map((p) => pos2(p).y + pos2(p).h));
|
|
10753
|
+
let id = nextPanelId(existing);
|
|
10754
|
+
const place = (p) => ({ ...p, id: id++, gridPos: { ...pos2(p), y: pos2(p).y + top }, ...p.panels && { panels: p.panels.map(place) } });
|
|
10755
|
+
const pasted = incoming.map(place);
|
|
10756
|
+
const index = existing.length;
|
|
10757
|
+
const all = [...existing, ...pasted];
|
|
10758
|
+
return {
|
|
10759
|
+
panels: settleLayout(all, pasted.map((_, i) => index + i)),
|
|
10760
|
+
variables,
|
|
10761
|
+
index,
|
|
10762
|
+
count: pasted.length,
|
|
10763
|
+
added,
|
|
10764
|
+
renamed,
|
|
10765
|
+
skipped
|
|
10766
|
+
};
|
|
10767
|
+
}
|
|
10768
|
+
|
|
10769
|
+
|
|
10770
|
+
|
|
10771
|
+
|
|
10772
|
+
|
|
10773
|
+
|
|
10774
|
+
|
|
10775
|
+
|
|
10776
|
+
|
|
10777
|
+
|
|
10778
|
+
|
|
10779
|
+
|
|
10499
10780
|
|
|
10500
10781
|
|
|
10501
10782
|
|
|
@@ -10687,4 +10968,4 @@ function sampleEntries(forms, metrics, now = Date.now(), days = 180) {
|
|
|
10687
10968
|
|
|
10688
10969
|
|
|
10689
10970
|
|
|
10690
|
-
exports.frameLength = frameLength; exports.timeField = timeField; exports.numberFields = numberFields; exports.fieldDisplayName = fieldDisplayName; exports.toSeries = toSeries; exports.toXYSeries = toXYSeries; exports.uniqueNames = uniqueNames; exports.toMillis = toMillis; exports.parseTime = parseTime; exports.parseRange = parseRange; exports.addTime = addTime; exports.startOf = startOf; exports.parseDuration = parseDuration; exports.calculateInterval = calculateInterval; exports.formatDuration = formatDuration; exports.TIME_PRESETS = TIME_PRESETS; exports.RELATIVE_RANGES = RELATIVE_RANGES; exports.parseLocalDateTime = parseLocalDateTime; exports.formatLocalDateTime = formatLocalDateTime; exports.timeExprError = timeExprError; exports.describeRange = describeRange; exports.zoomRange = zoomRange; exports.ALL = ALL; exports.initialVariableValues = initialVariableValues; exports.variableOptions = variableOptions; exports.variableInfo = variableInfo; exports.visibleVariables = visibleVariables; exports.isSqlDatasource = isSqlDatasource; exports.framesToOptions = framesToOptions; exports.refineOptions = refineOptions; exports.selectValue = selectValue; exports.variableReferences = variableReferences; exports.interpolate = interpolate; exports.queryParam = queryParam; exports.interpolateDeep = interpolateDeep; exports.resolveTimezone = resolveTimezone; exports.valueText = valueText; exports.GRID_COLUMNS = GRID_COLUMNS; exports.gridUnitsToPx = gridUnitsToPx; exports.isRow = isRow; exports.layoutDashboard = layoutDashboard; exports.repeatOptions = repeatOptions; exports.panelKey = panelKey; exports.panelSpan = panelSpan; exports.applyTransformations = applyTransformations; exports.DASHBOARD_DS = DASHBOARD_DS; exports.dashboardSourceIds = dashboardSourceIds; exports.panelHasQueries = panelHasQueries; exports.queryPanel = queryPanel; exports.normalizeRef = normalizeRef; exports.refreshedVariables = refreshedVariables; exports.variableDependents = variableDependents; exports.variableOrder = variableOrder; exports.resolveVariables = resolveVariables; exports.REDUCER_LABELS = REDUCER_LABELS; exports.isReducer = isReducer; exports.reduce = reduce; exports.INPUT_OPTION_KEYS = INPUT_OPTION_KEYS; exports.INPUT_TYPES = INPUT_TYPES; exports.isInputType = isInputType; exports.isInputPanel = isInputPanel; exports.inputPanels = inputPanels; exports.parseClockDigits = parseClockDigits; exports.formatClock = formatClock; exports.toEntries = toEntries; exports.inputProblem = inputProblem; exports.entryToInputValue = entryToInputValue; exports.textSuggestions = textSuggestions; exports.entriesSavedWith = entriesSavedWith; exports.formatValue = formatValue; exports.thresholdStep = thresholdStep; exports.NAMED_COLORS = NAMED_COLORS; exports.resolveColor = resolveColor; exports.SERIES_PALETTE = SERIES_PALETTE; exports.seriesColor = seriesColor; exports.mappedResult = mappedResult; exports.formatDisplay = formatDisplay; exports.valueColor = valueColor; exports.resolveFieldConfig = resolveFieldConfig; exports.fieldMatches = fieldMatches; exports.GrafanaError = GrafanaError; exports.GrafanaClient = GrafanaClient; exports.GrafanaDataSource = GrafanaDataSource; exports.fromWire = fromWire; exports.LOCAL_DATASOURCE_TYPE = LOCAL_DATASOURCE_TYPE; exports.isLocalDatasource = isLocalDatasource; exports.LocalDataSource = LocalDataSource; exports.buildFrames = buildFrames; exports.MemoryEntryStore = MemoryEntryStore; exports.DEFAULT_GAZETTEER = DEFAULT_GAZETTEER; exports.parseGazetteer = parseGazetteer; exports.loadGazetteer = loadGazetteer; exports.resolveLinks = resolveLinks; exports.parseDashboardLink = parseDashboardLink; exports.applyDashboardLink = applyDashboardLink; exports.appSchema = appSchema; exports.dashboardSchema = dashboardSchema; exports.pointerToPath = pointerToPath; exports.manifestSchemaIssues = manifestSchemaIssues; exports.dashboardSchemaIssues = dashboardSchemaIssues; exports.cleanDashboard = cleanDashboard; exports.MAPPING_TYPES = MAPPING_TYPES; exports.SPECIAL_MATCHES = SPECIAL_MATCHES; exports.mappingRows = mappingRows; exports.rowsToMappings = rowsToMappings; exports.mappingRow = mappingRow; exports.mappingProblem = mappingProblem; exports.OPTION_CATEGORIES = OPTION_CATEGORIES; exports.UNIT_CHOICES = UNIT_CHOICES; exports.panelOptions = panelOptions; exports.getPath = getPath; exports.optionValue = optionValue; exports.setOption = setOption; exports.setOptionValue = setOptionValue; exports.cleanPanelOptions = cleanPanelOptions; exports.OVERRIDE_MATCHERS = OVERRIDE_MATCHERS; exports.overrideProperties = overrideProperties; exports.panelOverrides = panelOverrides; exports.setOverrides = setOverrides; exports.MANIFEST_VERSION = MANIFEST_VERSION; exports.validateManifest = validateManifest; exports.prepareDashboard = prepareDashboard; exports.validateDashboard = validateDashboard2; exports.validateBundle = validateBundle; exports.resolveUrl = resolveUrl; exports.httpFetchJson = httpFetchJson; exports.defaultFetchJson = defaultFetchJson; exports.BUNDLE_TYPE = BUNDLE_TYPE; exports.BUNDLE_ACCEPT = BUNDLE_ACCEPT; exports.isBundleResponse = isBundleResponse; exports.bundleRoot = bundleRoot; exports.assembleFromResponse = assembleFromResponse; exports.assembleBundle = assembleBundle; exports.fetchBundle = fetchBundle; exports.revalidateBundle = revalidateBundle; exports.ConfigLoader = ConfigLoader; exports.tabIdFor = tabIdFor; exports.screenOfType = screenOfType; exports.screenDocuments = screenDocuments; exports.documentUses = documentUses; exports.stringifyCompact = stringifyCompact; exports.applyJsonEdits = applyJsonEdits; exports.diffJson = diffJson; exports.documentIdFor = documentIdFor; exports.removeDocumentFromManifest = removeDocumentFromManifest; exports.renameDocumentInManifest = renameDocumentInManifest; exports.metricChanges = metricChanges; exports.REFRESH_CHOICES = REFRESH_CHOICES; exports.EDITABLE_VARIABLE_TYPES = EDITABLE_VARIABLE_TYPES; exports.isEditableVariableType = isEditableVariableType; exports.variableNameError = variableNameError; exports.newVariable = newVariable; exports.variableWithType = variableWithType; exports.variableWithQuery = variableWithQuery; exports.variableWithCurrent = variableWithCurrent; exports.variableWithFlags = variableWithFlags; exports.variableUses = variableUses; exports.renameVariableInPanels = renameVariableInPanels; exports.lineColumn = lineColumn; exports.parseJsonText = parseJsonText; exports.splitPath = splitPath; exports.locate = locate; exports.checkFiles = checkFiles; exports.bundleFromFiles = bundleFromFiles; exports.formatJsonText = formatJsonText; exports.setJsonValue = setJsonValue; exports.PANEL_TYPES = PANEL_TYPES; exports.newPanel = newPanel; exports.newDocument = newDocument; exports.SaveConflictError = SaveConflictError; exports.HttpConfigFiles = HttpConfigFiles; exports.fetchJsonWithToken = fetchJsonWithToken; exports.readConfigFiles = readConfigFiles; exports.readingOrder = readingOrder; exports.repack = repack; exports.CANVAS_GAP = CANVAS_GAP; exports.CANVAS_ROW_HEADER = CANVAS_ROW_HEADER; exports.panelSize = panelSize; exports.layoutCanvas = layoutCanvas; exports.dropTarget = dropTarget; exports.movePanel = movePanel; exports.resizePanel = resizePanel; exports.setHiddenOnPhones = setHiddenOnPhones; exports.nextPanelId = nextPanelId; exports.insertPanel = insertPanel; exports.duplicatePanel = duplicatePanel; exports.removePanel = removePanel; exports.expandRow = expandRow; exports.panelEdits = panelEdits; exports.sampleEntries = sampleEntries;
|
|
10971
|
+
exports.frameLength = frameLength; exports.timeField = timeField; exports.numberFields = numberFields; exports.fieldDisplayName = fieldDisplayName; exports.toSeries = toSeries; exports.toXYSeries = toXYSeries; exports.uniqueNames = uniqueNames; exports.toMillis = toMillis; exports.parseTime = parseTime; exports.parseRange = parseRange; exports.addTime = addTime; exports.startOf = startOf; exports.parseDuration = parseDuration; exports.calculateInterval = calculateInterval; exports.formatDuration = formatDuration; exports.TIME_PRESETS = TIME_PRESETS; exports.RELATIVE_RANGES = RELATIVE_RANGES; exports.parseLocalDateTime = parseLocalDateTime; exports.formatLocalDateTime = formatLocalDateTime; exports.timeExprError = timeExprError; exports.describeRange = describeRange; exports.zoomRange = zoomRange; exports.ALL = ALL; exports.initialVariableValues = initialVariableValues; exports.variableOptions = variableOptions; exports.variableInfo = variableInfo; exports.visibleVariables = visibleVariables; exports.isSqlDatasource = isSqlDatasource; exports.framesToOptions = framesToOptions; exports.refineOptions = refineOptions; exports.selectValue = selectValue; exports.variableReferences = variableReferences; exports.interpolate = interpolate; exports.queryParam = queryParam; exports.interpolateDeep = interpolateDeep; exports.resolveTimezone = resolveTimezone; exports.valueText = valueText; exports.GRID_COLUMNS = GRID_COLUMNS; exports.gridUnitsToPx = gridUnitsToPx; exports.gridOffsetPx = gridOffsetPx; exports.compactGrid = compactGrid; exports.isRow = isRow; exports.layoutDashboard = layoutDashboard; exports.repeatOptions = repeatOptions; exports.panelKey = panelKey; exports.panelSpan = panelSpan; exports.applyTransformations = applyTransformations; exports.DASHBOARD_DS = DASHBOARD_DS; exports.dashboardSourceIds = dashboardSourceIds; exports.panelHasQueries = panelHasQueries; exports.queryPanel = queryPanel; exports.normalizeRef = normalizeRef; exports.refreshedVariables = refreshedVariables; exports.variableDependents = variableDependents; exports.variableOrder = variableOrder; exports.resolveVariables = resolveVariables; exports.REDUCER_LABELS = REDUCER_LABELS; exports.isReducer = isReducer; exports.reduce = reduce; exports.INPUT_OPTION_KEYS = INPUT_OPTION_KEYS; exports.INPUT_TYPES = INPUT_TYPES; exports.isInputType = isInputType; exports.isInputPanel = isInputPanel; exports.inputPanels = inputPanels; exports.parseClockDigits = parseClockDigits; exports.formatClock = formatClock; exports.toEntries = toEntries; exports.inputProblem = inputProblem; exports.entryToInputValue = entryToInputValue; exports.textSuggestions = textSuggestions; exports.entriesSavedWith = entriesSavedWith; exports.formatValue = formatValue; exports.thresholdStep = thresholdStep; exports.NAMED_COLORS = NAMED_COLORS; exports.resolveColor = resolveColor; exports.SERIES_PALETTE = SERIES_PALETTE; exports.seriesColor = seriesColor; exports.mappedResult = mappedResult; exports.formatDisplay = formatDisplay; exports.valueColor = valueColor; exports.resolveFieldConfig = resolveFieldConfig; exports.fieldMatches = fieldMatches; exports.GrafanaError = GrafanaError; exports.GrafanaClient = GrafanaClient; exports.GrafanaDataSource = GrafanaDataSource; exports.fromWire = fromWire; exports.LOCAL_DATASOURCE_TYPE = LOCAL_DATASOURCE_TYPE; exports.isLocalDatasource = isLocalDatasource; exports.LocalDataSource = LocalDataSource; exports.buildFrames = buildFrames; exports.MemoryEntryStore = MemoryEntryStore; exports.DEFAULT_GAZETTEER = DEFAULT_GAZETTEER; exports.parseGazetteer = parseGazetteer; exports.loadGazetteer = loadGazetteer; exports.resolveLinks = resolveLinks; exports.parseDashboardLink = parseDashboardLink; exports.applyDashboardLink = applyDashboardLink; exports.appSchema = appSchema; exports.dashboardSchema = dashboardSchema; exports.pointerToPath = pointerToPath; exports.manifestSchemaIssues = manifestSchemaIssues; exports.dashboardSchemaIssues = dashboardSchemaIssues; exports.cleanDashboard = cleanDashboard; exports.MAPPING_TYPES = MAPPING_TYPES; exports.SPECIAL_MATCHES = SPECIAL_MATCHES; exports.mappingRows = mappingRows; exports.rowsToMappings = rowsToMappings; exports.mappingRow = mappingRow; exports.mappingProblem = mappingProblem; exports.OPTION_CATEGORIES = OPTION_CATEGORIES; exports.UNIT_CHOICES = UNIT_CHOICES; exports.panelOptions = panelOptions; exports.getPath = getPath; exports.optionValue = optionValue; exports.setOption = setOption; exports.setOptionValue = setOptionValue; exports.cleanPanelOptions = cleanPanelOptions; exports.OVERRIDE_MATCHERS = OVERRIDE_MATCHERS; exports.overrideProperties = overrideProperties; exports.panelOverrides = panelOverrides; exports.setOverrides = setOverrides; exports.MANIFEST_VERSION = MANIFEST_VERSION; exports.validateManifest = validateManifest; exports.prepareDashboard = prepareDashboard; exports.validateDashboard = validateDashboard2; exports.validateBundle = validateBundle; exports.resolveUrl = resolveUrl; exports.httpFetchJson = httpFetchJson; exports.defaultFetchJson = defaultFetchJson; exports.BUNDLE_TYPE = BUNDLE_TYPE; exports.BUNDLE_ACCEPT = BUNDLE_ACCEPT; exports.isBundleResponse = isBundleResponse; exports.bundleRoot = bundleRoot; exports.assembleFromResponse = assembleFromResponse; exports.assembleBundle = assembleBundle; exports.fetchBundle = fetchBundle; exports.revalidateBundle = revalidateBundle; exports.ConfigLoader = ConfigLoader; exports.tabIdFor = tabIdFor; exports.screenOfType = screenOfType; exports.screenDocuments = screenDocuments; exports.documentUses = documentUses; exports.stringifyCompact = stringifyCompact; exports.applyJsonEdits = applyJsonEdits; exports.diffJson = diffJson; exports.documentIdFor = documentIdFor; exports.removeDocumentFromManifest = removeDocumentFromManifest; exports.renameDocumentInManifest = renameDocumentInManifest; exports.metricChanges = metricChanges; exports.REFRESH_CHOICES = REFRESH_CHOICES; exports.EDITABLE_VARIABLE_TYPES = EDITABLE_VARIABLE_TYPES; exports.isEditableVariableType = isEditableVariableType; exports.variableNameError = variableNameError; exports.newVariable = newVariable; exports.variableWithType = variableWithType; exports.variableWithQuery = variableWithQuery; exports.variableWithCurrent = variableWithCurrent; exports.variableWithFlags = variableWithFlags; exports.variableUses = variableUses; exports.renameVariableInPanels = renameVariableInPanels; exports.lineColumn = lineColumn; exports.parseJsonText = parseJsonText; exports.splitPath = splitPath; exports.locate = locate; exports.checkFiles = checkFiles; exports.bundleFromFiles = bundleFromFiles; exports.formatJsonText = formatJsonText; exports.setJsonValue = setJsonValue; exports.PANEL_TYPES = PANEL_TYPES; exports.newPanel = newPanel; exports.newDocument = newDocument; exports.SaveConflictError = SaveConflictError; exports.HttpConfigFiles = HttpConfigFiles; exports.fetchJsonWithToken = fetchJsonWithToken; exports.readConfigFiles = readConfigFiles; exports.readingOrder = readingOrder; exports.repack = repack; exports.CANVAS_GAP = CANVAS_GAP; exports.CANVAS_ROW_HEADER = CANVAS_ROW_HEADER; exports.panelSize = panelSize; exports.layoutCanvas = layoutCanvas; exports.dropTarget = dropTarget; exports.movePanel = movePanel; exports.resizePanel = resizePanel; exports.setHiddenOnPhones = setHiddenOnPhones; exports.nextPanelId = nextPanelId; exports.insertPanel = insertPanel; exports.duplicatePanel = duplicatePanel; exports.removePanel = removePanel; exports.expandRow = expandRow; exports.collapseRow = collapseRow; exports.settleLayout = settleLayout; exports.placePanel = placePanel; exports.snapToGrid = snapToGrid; exports.panelEdits = panelEdits; exports.sampleEntries = sampleEntries; exports.SNIPPET_VERSION = SNIPPET_VERSION; exports.copyPanels = copyPanels; exports.parseSnippet = parseSnippet; exports.previewPaste = previewPaste; exports.pasteSnippet = pasteSnippet;
|