@malloy-publisher/app 0.8.3 → 0.8.5
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/api-doc.yaml +205 -28
- package/dist/assets/EnvironmentPage-D0689eMH.js +1 -0
- package/dist/assets/{HomePage-CuE7CQ6D.js → HomePage-CQwxmRju.js} +1 -1
- package/dist/assets/{LightMode-8tTlWDaS.js → LightMode-DzUuDGQu.js} +1 -1
- package/dist/assets/{MainPage-Bh0ouhmb.js → MainPage-CWebuoie.js} +2 -2
- package/dist/assets/ModelPage-DddcQtR_.js +2 -0
- package/dist/assets/PackagePage-B_6x-Kp1.js +1 -0
- package/dist/assets/{RenderedResult-BfayOSk1.es-PT9iz4RF.js → RenderedResult-BRgIgxWh.es-B6GsiQaB.js} +3 -3
- package/dist/assets/RouteError-D85c0IXR.js +1 -0
- package/dist/assets/{ThemeEditorPage-D8rQ1UJ_.js → ThemeEditorPage-DPFZnuXS.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-CPFcR4JM.js → ToggleButtonGroup-B2KkD7kC.js} +1 -1
- package/dist/assets/{index-BS2OPPD1.js → index-125-Lr5Z.js} +1 -1
- package/dist/assets/{index-Cac5moUn.js → index-BK_RS5eN.js} +3 -3
- package/dist/assets/index-BSBGZfIc.js +450 -0
- package/dist/assets/{index-BDtgOesj.js → index-BbrJd6fQ.js} +1 -1
- package/dist/assets/{index-BxPJ-qDv.js → index-mS-LEGFh.js} +1 -1
- package/dist/assets/index.es-Dixkq2YH.js +111 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/EnvironmentPage-D7q_mnLa.js +0 -1
- package/dist/assets/ModelPage-RZ9sXvLC.js +0 -2
- package/dist/assets/PackagePage-DBdb47ZN.js +0 -1
- package/dist/assets/RouteError-CZMzHtwS.js +0 -1
- package/dist/assets/index-zr-x34Gt.js +0 -442
- package/dist/assets/index.es-CsApNQ2l.js +0 -111
package/dist/api-doc.yaml
CHANGED
|
@@ -7,7 +7,7 @@ info:
|
|
|
7
7
|
description: |
|
|
8
8
|
The Malloy Publisher - Semantic Model Serving API provides access to Malloy packages and everything they contain.
|
|
9
9
|
A Malloy package is a directory with a `publisher.json` manifest at its root, holding Malloy models (`.malloy` files),
|
|
10
|
-
notebooks (`.malloynb` files), embedded data (`.parquet`, `.csv`, and `.xlsx` files), and optionally an HTML data app
|
|
10
|
+
notebooks (`.malloynb` files and `.malloy` files under `notebooks/`), embedded data (`.parquet`, `.csv`, and `.xlsx` files), and optionally an HTML data app
|
|
11
11
|
under `public/`.
|
|
12
12
|
|
|
13
13
|
## Key Features
|
|
@@ -1567,9 +1567,16 @@ paths:
|
|
|
1567
1567
|
operationId: list-models
|
|
1568
1568
|
summary: List package models
|
|
1569
1569
|
description: |
|
|
1570
|
-
Retrieves
|
|
1571
|
-
|
|
1572
|
-
|
|
1570
|
+
Retrieves the Malloy models within the specified package. Each model entry includes
|
|
1571
|
+
the relative path, package name, whether the package hides the file, and any
|
|
1572
|
+
compilation errors.
|
|
1573
|
+
|
|
1574
|
+
On a package with a surface (a root `index.malloy`, or a legacy `explores`), only the
|
|
1575
|
+
files on that surface are listed, unless `includeHiddenFilesAndSources` is true. With it, every
|
|
1576
|
+
model file is listed, and `isHidden` marks the ones the package hides. Dashboard files
|
|
1577
|
+
are listed by the dashboards route either way. Served notebooks (`.malloy` files under
|
|
1578
|
+
`notebooks/` that carry an `## artifact` note) are not models here, with or without a
|
|
1579
|
+
surface; they are listed by list-notebooks.
|
|
1573
1580
|
parameters:
|
|
1574
1581
|
- name: environmentName
|
|
1575
1582
|
in: path
|
|
@@ -1589,6 +1596,7 @@ paths:
|
|
|
1589
1596
|
required: false
|
|
1590
1597
|
schema:
|
|
1591
1598
|
$ref: "#/components/schemas/VersionIdPattern"
|
|
1599
|
+
- $ref: "#/components/parameters/includeHiddenFilesAndSources"
|
|
1592
1600
|
responses:
|
|
1593
1601
|
"200":
|
|
1594
1602
|
description: A list of models in the package
|
|
@@ -1621,14 +1629,16 @@ paths:
|
|
|
1621
1629
|
provides access to the model's structure, sources, and named queries for use in applications.
|
|
1622
1630
|
|
|
1623
1631
|
On a package with a surface (a root `index.malloy`, or a legacy `explores`), a file off
|
|
1624
|
-
that surface answers 404 with the same message a query to it gets
|
|
1625
|
-
|
|
1626
|
-
|
|
1632
|
+
that surface answers 404 with the same message a query to it gets, unless
|
|
1633
|
+
`includeHiddenFilesAndSources` is true. With it, the file is returned with its `sourceText`, whatever
|
|
1634
|
+
sources the text names. Dashboard files and served notebooks (`notebooks/*.malloy` with
|
|
1635
|
+
an `## artifact` note) are always returned. A package with no surface, or with
|
|
1636
|
+
`queryableSources: "all"`, returns every file. For a file it returns, `modelDef.contents` and `modelDef.exports`,
|
|
1627
1637
|
`modelInfo`, `sources` and `sourceInfos` are limited to the names the file publishes, so
|
|
1628
1638
|
the surface file does not carry the hidden sources it imports. A join to a hidden source
|
|
1629
1639
|
keeps only its name and the names and types of its fields. `sourceText` is left out
|
|
1630
|
-
when the text names a source the file does not publish; a dashboard
|
|
1631
|
-
returned.
|
|
1640
|
+
when the text names a source the file does not publish; the text of a dashboard is
|
|
1641
|
+
always returned.
|
|
1632
1642
|
parameters:
|
|
1633
1643
|
- name: environmentName
|
|
1634
1644
|
in: path
|
|
@@ -1654,6 +1664,7 @@ paths:
|
|
|
1654
1664
|
required: false
|
|
1655
1665
|
schema:
|
|
1656
1666
|
$ref: "#/components/schemas/VersionIdPattern"
|
|
1667
|
+
- $ref: "#/components/parameters/includeHiddenFilesAndSources"
|
|
1657
1668
|
responses:
|
|
1658
1669
|
"200":
|
|
1659
1670
|
description: Compiled Malloy model
|
|
@@ -1808,6 +1819,7 @@ paths:
|
|
|
1808
1819
|
required: true
|
|
1809
1820
|
schema:
|
|
1810
1821
|
$ref: "#/components/schemas/PathPattern"
|
|
1822
|
+
- $ref: "#/components/parameters/includeHiddenFilesAndSources"
|
|
1811
1823
|
requestBody:
|
|
1812
1824
|
required: true
|
|
1813
1825
|
content:
|
|
@@ -2042,8 +2054,10 @@ paths:
|
|
|
2042
2054
|
operationId: list-notebooks
|
|
2043
2055
|
summary: List package notebooks
|
|
2044
2056
|
description: |
|
|
2045
|
-
Retrieves a list of all Malloy notebooks within the specified package
|
|
2046
|
-
|
|
2057
|
+
Retrieves a list of all Malloy notebooks within the specified package: every
|
|
2058
|
+
`.malloynb` file, and every `.malloy` file directly under `notebooks/` that has a
|
|
2059
|
+
model-level `## artifact` note. Each notebook entry includes the relative path,
|
|
2060
|
+
package name, title, description, and any compilation or reading error. This endpoint
|
|
2047
2061
|
is useful for discovering available notebooks and checking their status.
|
|
2048
2062
|
parameters:
|
|
2049
2063
|
- name: environmentName
|
|
@@ -2066,7 +2080,7 @@ paths:
|
|
|
2066
2080
|
$ref: "#/components/schemas/VersionIdPattern"
|
|
2067
2081
|
responses:
|
|
2068
2082
|
"200":
|
|
2069
|
-
description: A list of
|
|
2083
|
+
description: A list of notebooks in the package
|
|
2070
2084
|
content:
|
|
2071
2085
|
application/json:
|
|
2072
2086
|
schema:
|
|
@@ -2093,6 +2107,8 @@ paths:
|
|
|
2093
2107
|
description: |
|
|
2094
2108
|
Retrieves a Malloy notebook with its raw cell contents (markdown and code).
|
|
2095
2109
|
Cell execution should be done separately via the execute-notebook-cell endpoint.
|
|
2110
|
+
A served `notebooks/*.malloy` (one with an `## artifact` note) answers here as well as a
|
|
2111
|
+
`.malloynb`.
|
|
2096
2112
|
On a package with a surface, the response shows only the sources the notebook may read.
|
|
2097
2113
|
parameters:
|
|
2098
2114
|
- name: environmentName
|
|
@@ -2144,7 +2160,8 @@ paths:
|
|
|
2144
2160
|
description: |
|
|
2145
2161
|
Executes a specific cell in a Malloy notebook by index. For code cells, this compiles
|
|
2146
2162
|
and runs the Malloy code, returning query results and any new sources defined.
|
|
2147
|
-
For markdown cells, this simply returns the cell content.
|
|
2163
|
+
For markdown cells, this simply returns the cell content. A served `notebooks/*.malloy`
|
|
2164
|
+
answers here as well as a `.malloynb`.
|
|
2148
2165
|
|
|
2149
2166
|
On a package with a surface (a root `index.malloy`, or a legacy `explores`) with
|
|
2150
2167
|
`queryableSources` left at `"declared"`, a code cell may read only sources the surface
|
|
@@ -3221,7 +3238,28 @@ components:
|
|
|
3221
3238
|
than about the package: one when a file carrying an artifact tag
|
|
3222
3239
|
could not be read and so is not served at all, and one when the lint
|
|
3223
3240
|
stops early, in which case the list must be read as incomplete
|
|
3224
|
-
rather than as a clean package.
|
|
3241
|
+
rather than as a clean package. Notebook findings: a `notebooks/`
|
|
3242
|
+
file with an `## artifact` note whose cells could not be read, which
|
|
3243
|
+
names the line and the fix and is reported with severity `error`,
|
|
3244
|
+
because the notebook is served with that error instead of opening.
|
|
3245
|
+
The same family carries findings on files under `notebooks/` and
|
|
3246
|
+
`dashboards/`, each naming its line and the fix; they are computed
|
|
3247
|
+
at discovery and are also returned by `/compile` at file and
|
|
3248
|
+
package scope. Eight codes are `error` and fail `/compile`:
|
|
3249
|
+
`notebook-statement-above-artifact` and `notebook-tag-above-artifact`
|
|
3250
|
+
(a statement or a tag above a served notebook's `## artifact`),
|
|
3251
|
+
`notebook-markdown-above-artifact` (a `(markdown)` annotation above
|
|
3252
|
+
it), `notebook-columns-conflict` (a tiled dashboard's
|
|
3253
|
+
`dashboard_columns` disagrees with `dashboard { columns }`),
|
|
3254
|
+
`notebook-markdown-opener-text` (more than a
|
|
3255
|
+
name after `(markdown)` on a block's opener),
|
|
3256
|
+
`notebook-markdown-attached-nowhere` (a `#(markdown)` annotation
|
|
3257
|
+
with no statement to take it), `notebook-artifact-unparsed` (an
|
|
3258
|
+
`## artifact` tag does not parse), and `notebook-cells-unreadable`
|
|
3259
|
+
(the reader could not read a served notebook's cells). The rest are
|
|
3260
|
+
`warn` (a mistyped `(markdown)` opener, a missing `kind=notebook`, a
|
|
3261
|
+
block that never closes, and similar).
|
|
3262
|
+
Server-computed and read-only:
|
|
3225
3263
|
ignored on
|
|
3226
3264
|
create/update requests and only returned in responses. Present only
|
|
3227
3265
|
when there are such findings.
|
|
@@ -3779,6 +3817,15 @@ components:
|
|
|
3779
3817
|
path:
|
|
3780
3818
|
type: string
|
|
3781
3819
|
description: Relative path to the model file within its package directory
|
|
3820
|
+
isHidden:
|
|
3821
|
+
type: boolean
|
|
3822
|
+
description: |
|
|
3823
|
+
True for a file this route lists only because the request set
|
|
3824
|
+
`includeHiddenFilesAndSources`: a file the package's `index.malloy` (or a
|
|
3825
|
+
legacy `explores`) does not expose. False for every other file, so every
|
|
3826
|
+
entry is false without that option. It says whether the file is hidden, not
|
|
3827
|
+
whether a query can reach it: under `queryableSources: "all"` a hidden file
|
|
3828
|
+
can still be queried.
|
|
3782
3829
|
error:
|
|
3783
3830
|
type: string
|
|
3784
3831
|
description: Error message if the model failed to compile or load
|
|
@@ -3799,12 +3846,18 @@ components:
|
|
|
3799
3846
|
title:
|
|
3800
3847
|
type: string
|
|
3801
3848
|
description:
|
|
3802
|
-
Human title
|
|
3803
|
-
its `#"` doc comment, then its first markdown heading.
|
|
3804
|
-
|
|
3849
|
+
Human title. For a `.malloynb`, resolved from its own `## title="…"`,
|
|
3850
|
+
then its `#"` doc comment, then its first markdown heading. For a
|
|
3851
|
+
`.malloy` notebook, from the `title` in its `## artifact` tag, then
|
|
3852
|
+
the first line of the `"` notes above that tag, then its first
|
|
3853
|
+
markdown heading when no prose precedes it. Absent when none of
|
|
3854
|
+
those resolve, leaving the caller to show the path.
|
|
3805
3855
|
description:
|
|
3806
3856
|
type: string
|
|
3807
|
-
description:
|
|
3857
|
+
description:
|
|
3858
|
+
The notebook's doc comment, when it has one. For a `.malloy`
|
|
3859
|
+
notebook that is the `"` notes above the `## artifact` line; prose
|
|
3860
|
+
below it is a `##(markdown)` or `##|(markdown)` cell.
|
|
3808
3861
|
error:
|
|
3809
3862
|
type: string
|
|
3810
3863
|
description: Error message if the notebook failed to compile or load
|
|
@@ -3840,7 +3893,10 @@ components:
|
|
|
3840
3893
|
doc comment and then to the slug
|
|
3841
3894
|
description:
|
|
3842
3895
|
type: string
|
|
3843
|
-
description:
|
|
3896
|
+
description: >-
|
|
3897
|
+
The file's unnamed `"` notes above the `## artifact` tag; when it
|
|
3898
|
+
has none there, the ones below it (a legacy spot the lint flags). For
|
|
3899
|
+
a dashboard whose tag sits on one query, that query's `#"` notes.
|
|
3844
3900
|
error:
|
|
3845
3901
|
type: string
|
|
3846
3902
|
description: Error message if the dashboard file failed to compile
|
|
@@ -3881,7 +3937,10 @@ components:
|
|
|
3881
3937
|
doc comment and then to the slug
|
|
3882
3938
|
description:
|
|
3883
3939
|
type: string
|
|
3884
|
-
description:
|
|
3940
|
+
description: >-
|
|
3941
|
+
The file's unnamed `"` notes above the `## artifact` tag; when it
|
|
3942
|
+
has none there, the ones below it (a legacy spot the lint flags). For
|
|
3943
|
+
a dashboard whose tag sits on one query, that query's `#"` notes.
|
|
3885
3944
|
error:
|
|
3886
3945
|
type: string
|
|
3887
3946
|
description: Error message if the dashboard file failed to compile
|
|
@@ -4063,6 +4122,14 @@ components:
|
|
|
4063
4122
|
modelPath:
|
|
4064
4123
|
type: string
|
|
4065
4124
|
description: Relative path to the notebook file within its package directory
|
|
4125
|
+
format:
|
|
4126
|
+
type: string
|
|
4127
|
+
enum: ["malloynb", "malloy"]
|
|
4128
|
+
description:
|
|
4129
|
+
The file format the notebook is written in. `malloynb` is the
|
|
4130
|
+
cell-separated format; `malloy` is a `.malloy` file under
|
|
4131
|
+
`notebooks/` with a model-level `## artifact` note, whose cells are
|
|
4132
|
+
its statements and its floating `(markdown)` notes in file order.
|
|
4066
4133
|
malloyVersion:
|
|
4067
4134
|
type: string
|
|
4068
4135
|
description: Version of the Malloy compiler used to generate the notebook data
|
|
@@ -4076,24 +4143,31 @@ components:
|
|
|
4076
4143
|
$ref: "#/components/schemas/NotebookCell"
|
|
4077
4144
|
annotations:
|
|
4078
4145
|
type: array
|
|
4079
|
-
description:
|
|
4146
|
+
description:
|
|
4147
|
+
Array of file-level (##) annotations attached to the notebook. For
|
|
4148
|
+
a `.malloy` notebook, every own note that is not a floating
|
|
4149
|
+
`(markdown)` cell, in file order, each note once. A `"` or `(text)`
|
|
4150
|
+
note below the `## artifact` tag is dropped and not listed.
|
|
4080
4151
|
items:
|
|
4081
4152
|
type: string
|
|
4082
4153
|
startingGivens:
|
|
4083
4154
|
allOf:
|
|
4084
4155
|
- $ref: "#/components/schemas/EncodedGivenValues"
|
|
4085
4156
|
description:
|
|
4086
|
-
Starting values for the notebook's controls
|
|
4087
|
-
|
|
4088
|
-
|
|
4157
|
+
Starting values for the notebook's controls. A `.malloy` notebook
|
|
4158
|
+
declares them in its artifact tag (`## artifact { givens { … } }`),
|
|
4159
|
+
a `.malloynb` in its file-level tags (`## givens { … }`). URL
|
|
4160
|
+
parameters override these, which is why the two share a shape.
|
|
4161
|
+
Omitted when the notebook declares none.
|
|
4089
4162
|
autorun:
|
|
4090
4163
|
type: boolean
|
|
4091
4164
|
description:
|
|
4092
4165
|
False batches control changes behind an Apply button instead of
|
|
4093
|
-
re-running on every change. Defaults to true.
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4166
|
+
re-running on every change. Defaults to true. A `.malloy` notebook
|
|
4167
|
+
reads it from its artifact tag (`## artifact { autorun=false }`), a
|
|
4168
|
+
`.malloynb` from its file-level tags (`## autorun=false`). The same
|
|
4169
|
+
flag, with the same default, that `DashboardManifest.autorun`
|
|
4170
|
+
carries.
|
|
4097
4171
|
sources:
|
|
4098
4172
|
type: array
|
|
4099
4173
|
description: Sources defined in the notebook's model
|
|
@@ -4565,9 +4639,56 @@ components:
|
|
|
4565
4639
|
type: string
|
|
4566
4640
|
enum: ["markdown", "code"]
|
|
4567
4641
|
description: Type of notebook cell
|
|
4642
|
+
kind:
|
|
4643
|
+
type: string
|
|
4644
|
+
enum: ["markdown", "query", "definition"]
|
|
4645
|
+
description:
|
|
4646
|
+
What a cell is, on a `.malloy` notebook. A definition cell
|
|
4647
|
+
(`source:`, `import`, `query:`, `given:`, `type:`, `export`) has type `code`
|
|
4648
|
+
and produces no result. Absent on a `.malloynb`.
|
|
4568
4649
|
text:
|
|
4569
4650
|
type: string
|
|
4570
4651
|
description: Text contents of the notebook cell (either markdown or Malloy code)
|
|
4652
|
+
markdown:
|
|
4653
|
+
type: string
|
|
4654
|
+
description:
|
|
4655
|
+
On a `.malloy` notebook's code cell, the prose written on the
|
|
4656
|
+
`(markdown)` route in its own tag lines (`#(markdown) text` lines,
|
|
4657
|
+
`#|(markdown)` … `|#` blocks), which `text` still contains. Blocks
|
|
4658
|
+
join with a blank line, adjacent lines with a newline. Author
|
|
4659
|
+
prose, so it is served even when `queryInfo` is withheld. Absent
|
|
4660
|
+
when the cell has none.
|
|
4661
|
+
proseLines:
|
|
4662
|
+
type: array
|
|
4663
|
+
description:
|
|
4664
|
+
Present on every code cell of a `.malloy` notebook, and absent on
|
|
4665
|
+
a `.malloynb` or from a server that predates it. The lines of
|
|
4666
|
+
`text` that hold `markdown`, as `[start, end]` pairs in file order;
|
|
4667
|
+
`[]` when the cell has none. Lines are 0-based and inclusive,
|
|
4668
|
+
counted on `text` split at `\n`. Strip exactly these lines to get
|
|
4669
|
+
the cell's code without its prose; do not re-derive them from
|
|
4670
|
+
`text`, whose first line has lost its indentation.
|
|
4671
|
+
items:
|
|
4672
|
+
type: array
|
|
4673
|
+
minItems: 2
|
|
4674
|
+
maxItems: 2
|
|
4675
|
+
items:
|
|
4676
|
+
type: integer
|
|
4677
|
+
codeLine:
|
|
4678
|
+
type: integer
|
|
4679
|
+
description:
|
|
4680
|
+
Present on every code cell of a `.malloy` notebook, as `proseLines`
|
|
4681
|
+
is. The 0-based line of `text` (split at `\n`) where the
|
|
4682
|
+
statement's code starts, its first token that is neither a note nor
|
|
4683
|
+
a comment, so the `source`, `run`, `given` or `import` keyword sits
|
|
4684
|
+
on it.
|
|
4685
|
+
caption:
|
|
4686
|
+
type: string
|
|
4687
|
+
description:
|
|
4688
|
+
On a `.malloy` notebook's code cell, the joined text of its leading
|
|
4689
|
+
`#"` lines (space-joined, trimmed). Author prose, so it is served
|
|
4690
|
+
even when `queryInfo` is withheld. Absent when the cell has none,
|
|
4691
|
+
which is authoritative wherever `proseLines` is present.
|
|
4571
4692
|
newSources:
|
|
4572
4693
|
type: array
|
|
4573
4694
|
description:
|
|
@@ -4590,9 +4711,33 @@ components:
|
|
|
4590
4711
|
type: string
|
|
4591
4712
|
enum: ["markdown", "code"]
|
|
4592
4713
|
description: Type of notebook cell
|
|
4714
|
+
kind:
|
|
4715
|
+
type: string
|
|
4716
|
+
enum: ["markdown", "query", "definition"]
|
|
4717
|
+
description: The cell's kind, on a `.malloy` notebook. Absent on a `.malloynb`.
|
|
4593
4718
|
text:
|
|
4594
4719
|
type: string
|
|
4595
4720
|
description: Text contents of the notebook cell
|
|
4721
|
+
markdown:
|
|
4722
|
+
type: string
|
|
4723
|
+
description:
|
|
4724
|
+
A `.malloy` notebook code cell's own `(markdown)` prose, as on
|
|
4725
|
+
`NotebookCell`. Absent when the cell has none.
|
|
4726
|
+
proseLines:
|
|
4727
|
+
type: array
|
|
4728
|
+
description: The lines of `text` that hold `markdown`, as on `NotebookCell`; `[]` when none.
|
|
4729
|
+
items:
|
|
4730
|
+
type: array
|
|
4731
|
+
minItems: 2
|
|
4732
|
+
maxItems: 2
|
|
4733
|
+
items:
|
|
4734
|
+
type: integer
|
|
4735
|
+
codeLine:
|
|
4736
|
+
type: integer
|
|
4737
|
+
description: The line of `text` where the statement's code starts, as on `NotebookCell`.
|
|
4738
|
+
caption:
|
|
4739
|
+
type: string
|
|
4740
|
+
description: The cell's leading `#"` caption, as on `NotebookCell`. Absent when the cell has none.
|
|
4596
4741
|
result:
|
|
4597
4742
|
type: string
|
|
4598
4743
|
description: JSON string containing the execution result for this cell
|
|
@@ -7180,6 +7325,38 @@ components:
|
|
|
7180
7325
|
gate rejects anyway.
|
|
7181
7326
|
|
|
7182
7327
|
parameters:
|
|
7328
|
+
includeHiddenFilesAndSources:
|
|
7329
|
+
name: includeHiddenFilesAndSources
|
|
7330
|
+
in: query
|
|
7331
|
+
required: false
|
|
7332
|
+
description: |
|
|
7333
|
+
When true, a package with a surface (a root `index.malloy`, or a legacy
|
|
7334
|
+
`explores`) is served to this request as if it had none: the models
|
|
7335
|
+
list includes the files off the surface, the model GET returns them, and
|
|
7336
|
+
the query route runs any model path the request names, including a
|
|
7337
|
+
dashboard or notebook file, against every source, as
|
|
7338
|
+
`queryableSources: "all"` does for every request. `#(authorize)` and
|
|
7339
|
+
`#(access_filter)` still apply: it lifts curation, never the lock.
|
|
7340
|
+
|
|
7341
|
+
The model GET goes one step further than `queryableSources: "all"`: it
|
|
7342
|
+
returns the file's `sourceText` even when that text names a source the
|
|
7343
|
+
file does not publish. That text can include `#(authorize)`
|
|
7344
|
+
expressions, `given:` defaults, connection names and raw SQL.
|
|
7345
|
+
|
|
7346
|
+
Only the models list, the model GET and the query route read it. The
|
|
7347
|
+
notebook-cell route, the dashboards route, the MCP tools, and the legacy
|
|
7348
|
+
`/projects/...` aliases of these routes ignore it.
|
|
7349
|
+
|
|
7350
|
+
Like every route on this server, it is unauthenticated. A deployment
|
|
7351
|
+
that authenticates in front of Publisher decides who may send it, and
|
|
7352
|
+
should pass it only for callers allowed to work with a package's hidden
|
|
7353
|
+
files, such as its authors.
|
|
7354
|
+
|
|
7355
|
+
Only `true` and `false` are accepted. Any other value is refused with
|
|
7356
|
+
400.
|
|
7357
|
+
schema:
|
|
7358
|
+
type: boolean
|
|
7359
|
+
default: false
|
|
7183
7360
|
environmentName:
|
|
7184
7361
|
name: environmentName
|
|
7185
7362
|
in: path
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as r,L as t,j as e,a7 as i,ai as o}from"./index-BSBGZfIc.js";function m(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f as t,j as o,M as a}from"./index-BSBGZfIc.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,j as s}from"./index-
|
|
1
|
+
import{c,j as s}from"./index-BSBGZfIc.js";const t=c(s.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),a=c(s.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}));export{t as D,a as L};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as Pe,g as Ce,
|
|
2
|
-
`)),(ye!==void 0?rt:et)(x,c,h,f,p)}}be();const nt=S(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),ot=z(Me,{name:"MuiBreadcrumbCollapsed"})(K(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:ne(e.palette.grey[200],.12)}:{backgroundColor:ne(e.palette.grey[600],.12)}}}))),st=z(nt)({width:24,height:16});function at(e){const{slots:r={},slotProps:n={},...o}=e,s=e;return t.jsx("li",{children:t.jsx(ot,{focusRipple:!0,...o,ownerState:s,children:t.jsx(st,{as:r.CollapsedIcon,ownerState:s,...n.collapsedIcon})})})}function it(e){return ce("MuiBreadcrumbs",e)}const lt=le("MuiBreadcrumbs",["root","ol","li","separator"]),ct=e=>{const{classes:r}=e;return pe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},it,r)},dt=z(Z,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${lt.li}`]:r.li},r.root]})({}),pt=z("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ut=z("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ht(e,r,n,o){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(ut,{"aria-hidden":!0,className:r,ownerState:o,children:n},`separator-${i}`)):s.push(a),s),[])}const ft=u.forwardRef(function(r,n){const o=de({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:c={},slotProps:h={},expandText:f="Show path",itemsAfterCollapse:p=1,itemsBeforeCollapse:x=1,maxItems:y=8,separator:E="/",...H}=o,[M,P]=u.useState(!1),v={...o,component:i,expanded:M,expandText:f,itemsAfterCollapse:p,itemsBeforeCollapse:x,maxItems:y,separator:E},C=ct(v),D=De({elementType:c.CollapsedIcon,externalSlotProps:h.collapsedIcon,ownerState:v}),j=u.useRef(null),k=d=>{const w=()=>{P(!0);const b=j.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return x+p>=d.length?d:[...d.slice(0,x),t.jsx(at,{"aria-label":f,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:D},onClick:w},"ellipsis"),...d.slice(d.length-p,d.length)]},T=u.Children.toArray(s).filter(d=>u.isValidElement(d)).map((d,w)=>t.jsx("li",{className:C.li,children:d},`child-${w}`));return t.jsx(dt,{ref:n,component:i,color:"textSecondary",className:U(C.root,a),ownerState:v,...H,children:t.jsx(pt,{className:C.ol,ref:j,ownerState:v,children:ht(M||y&&T.length<=y?T:k(T),C.separator,E,v)})})});function xt(e,r,n){const o=r.getBoundingClientRect(),s=n&&n.getBoundingClientRect(),a=ue(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const f=a.getComputedStyle(r);i=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let c=0,h=0;if(i&&i!=="none"&&typeof i=="string"){const f=i.split("(")[1].split(")")[0].split(",");c=parseInt(f[4],10),h=parseInt(f[5],10)}return e==="left"?s?`translateX(${s.right+c-o.left}px)`:`translateX(${a.innerWidth+c-o.left}px)`:e==="right"?s?`translateX(-${o.right-s.left-c}px)`:`translateX(-${o.left+o.width-c}px)`:e==="up"?s?`translateY(${s.bottom+h-o.top}px)`:`translateY(${a.innerHeight+h-o.top}px)`:s?`translateY(-${o.top-s.top+o.height-h}px)`:`translateY(-${o.top+o.height-h}px)`}function mt(e){return typeof e=="function"?e():e}function V(e,r,n){const o=mt(n),s=xt(e,r,o);s&&(r.style.webkitTransform=s,r.style.transform=s)}const gt=u.forwardRef(function(r,n){const o=G(),s={enter:o.transitions.easing.easeOut,exit:o.transitions.easing.sharp},a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{addEndListener:i,appear:c=!0,children:h,container:f,direction:p="down",easing:x=s,in:y,onEnter:E,onEntered:H,onEntering:M,onExit:P,onExited:v,onExiting:C,style:D,timeout:j=a,TransitionComponent:k=Te,...T}=r,d=u.useRef(null),w=Re(Be(h),d,n),b=l=>g=>{l&&(g===void 0?l(d.current):l(d.current,g))},Q=b((l,g)=>{V(p,l,f),He(l),E&&E(l,g)}),ee=b((l,g)=>{const L=oe({timeout:j,style:D,easing:x},{mode:"enter"});l.style.webkitTransition=o.transitions.create("-webkit-transform",{...L}),l.style.transition=o.transitions.create("transform",{...L}),l.style.webkitTransform="none",l.style.transform="none",M&&M(l,g)}),R=b(H),B=b(C),I=b(l=>{const g=oe({timeout:j,style:D,easing:x},{mode:"exit"});l.style.webkitTransition=o.transitions.create("-webkit-transform",g),l.style.transition=o.transitions.create("transform",g),V(p,l,f),P&&P(l)}),F=b(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),X=l=>{i&&i(d.current,l)},O=u.useCallback(()=>{d.current&&V(p,d.current,f)},[p,f]);return u.useEffect(()=>{if(y||p==="down"||p==="right")return;const l=Le(()=>{d.current&&V(p,d.current,f)}),g=ue(d.current);return g.addEventListener("resize",l),()=>{l.clear(),g.removeEventListener("resize",l)}},[p,y,f]),u.useEffect(()=>{y||O()},[y,O]),t.jsx(k,{nodeRef:d,onEnter:Q,onEntered:R,onEntering:ee,onExit:I,onExited:F,onExiting:B,addEndListener:X,appear:c,in:y,timeout:j,...T,children:(l,{ownerState:g,...L})=>u.cloneElement(h,{ref:w,style:{visibility:l==="exited"&&!y?"hidden":void 0,...D,...h.props.style},...L})})});function yt(e){return ce("MuiDrawer",e)}le("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const ve=(e,r)=>{const{ownerState:n}=e;return[r.root,(n.variant==="permanent"||n.variant==="persistent")&&r.docked,r.modal]},bt=e=>{const{classes:r,anchor:n,variant:o}=e,s={root:["root",`anchor${$(n)}`],docked:[(o==="permanent"||o==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(n)}`,o!=="temporary"&&`paperAnchorDocked${$(n)}`]};return pe(s,yt,r)},vt=z(Ae,{name:"MuiDrawer",slot:"Root",overridesResolver:ve})(K(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),jt=z("div",{shouldForwardProp:We,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:ve})({flex:"0 0 auto"}),kt=z(Oe,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:n}=e;return[r.paper,r[`paperAnchor${$(n.anchor)}`],n.variant!=="temporary"&&r[`paperAnchorDocked${$(n.anchor)}`]]}})(K(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),je={left:"right",right:"left",top:"down",bottom:"up"};function wt(e){return["left","right"].includes(e)}function St({direction:e},r){return e==="rtl"&&wt(r)?je[r]:r}const Et=u.forwardRef(function(r,n){const o=de({props:r,name:"MuiDrawer"}),s=G(),a=$e(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:c="left",BackdropProps:h,children:f,className:p,elevation:x=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:E,...H}={},onClose:M,open:P=!1,PaperProps:v={},SlideProps:C,TransitionComponent:D,transitionDuration:j=i,variant:k="temporary",slots:T={},slotProps:d={},...w}=o,b=u.useRef(!1);u.useEffect(()=>{b.current=!0},[]);const Q=St({direction:a?"rtl":"ltr"},c),R={...o,anchor:c,elevation:x,open:P,variant:k,...w},B=bt(R),I={slots:{transition:D,...T},slotProps:{paper:v,transition:C,...d,backdrop:Ne(d.backdrop||{...h,...E},{transitionDuration:j})}},[F,X]=W("root",{ref:n,elementType:vt,className:U(B.root,B.modal,p),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...I,...w,...H},additionalProps:{open:P,onClose:M,hideBackdrop:y,slots:{backdrop:I.slots.backdrop},slotProps:{backdrop:I.slotProps.backdrop}}}),[O,l]=W("paper",{elementType:kt,shouldForwardComponentProp:!0,className:U(B.paper,v.className),ownerState:R,externalForwardedProps:I,additionalProps:{elevation:k==="temporary"?x:0,square:!0,...k==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[g,L]=W("docked",{elementType:jt,ref:n,className:U(B.root,B.docked,p),ownerState:R,externalForwardedProps:I,additionalProps:w}),[Se,Ee]=W("transition",{elementType:gt,ownerState:R,externalForwardedProps:I,additionalProps:{in:P,direction:je[Q],timeout:j,appear:b.current}}),te=t.jsx(O,{...l,children:f});if(k==="permanent")return t.jsx(g,{...L,children:te});const re=t.jsx(Se,{...Ee,children:te});return k==="persistent"?t.jsx(g,{...L,children:re}):t.jsx(F,{...X,children:re})}),Pt=be({themeId:Ve}),Ct=S([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),It=S(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),zt=S(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),Mt=S(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),Dt=S(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),Tt=S(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Rt=S(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Bt=S([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]);function _(e){return t.jsxs(Ue,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}const Lt={light:"dark",dark:"auto",auto:"light"},ae={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Ht(){const{mode:e,userChoice:r,setMode:n,allowUserToggle:o}=Qe();if(!o)return null;const s=r??e,a=Lt[s],i=s==="auto"?It:s==="dark"?Je:qe;return t.jsx(A,{title:ae[s],children:t.jsx(N,{"aria-label":ae[s],onClick:()=>n(a),size:"small",children:t.jsx(i,{fontSize:"small"})})})}const ie="Visualization theme";function $t(){const e=Fe(),n=he().pathname.startsWith("/settings/theme");return t.jsx(A,{title:ie,children:t.jsx(N,{"aria-label":ie,onClick:()=>e("/settings/theme"),size:"small",color:n?"primary":"default",children:t.jsx(Bt,{fontSize:"small"})})})}function Y({label:e,onClick:r}){return t.jsx(Xe,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,sx:n=>({backgroundColor:"transparent",border:`1px solid ${n.palette.divider}`,color:"text.primary",fontWeight:500,fontSize:"0.875rem",height:32,cursor:"pointer",borderRadius:"4px",maxWidth:320,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:n.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function Nt(){const e=fe(),r=e["*"],n=J();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(m,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(ft,{"aria-label":"breadcrumb",separator:t.jsx(zt,{sx:{fontSize:14,color:"text.secondary"}}),children:[e.environmentName&&t.jsx(Y,{label:e.environmentName,onClick:o=>n(`/${e.environmentName}/`,o)}),e.packageName&&t.jsx(Y,{label:e.packageName,onClick:o=>n(`/${e.environmentName}/${e.packageName}/`,o)}),r&&t.jsx(Y,{label:r,onClick:o=>n(`/${e.environmentName}/${e.packageName}/${r}`,o)})]})})}const At=260,Ot=64;function ke({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){return t.jsxs(m,{sx:{height:"100dvh",width:e?Ot:At,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Wt,{isCollapsed:e,onToggleCollapse:r,logoHeader:n}),t.jsxs(m,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Vt,{isCollapsed:e}),t.jsx(Ut,{isCollapsed:e})]}),t.jsx(Qt,{isCollapsed:e})]})}function Wt({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){const o=J();return n?t.jsxs(m,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[n,t.jsx(N,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(_,{fontSize:"small"})})]}):t.jsxs(m,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(m,{onClick:s=>o("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(m,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(Z,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(A,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(N,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(_,{fontSize:"small"})})})]})}function Vt({isCollapsed:e}){const n=he().pathname==="/";return t.jsx(q,{sx:{py:0},children:t.jsx(we,{icon:t.jsx(Tt,{fontSize:"small"}),label:"Home",to:"/",selected:n,isCollapsed:e})})}function Ut({isCollapsed:e}){const{apiClients:r}=Ye(),n=fe(),{data:o}=_e({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=o?.data??[];return s.length===0?null:t.jsxs(m,{sx:{mt:1},children:[!e&&t.jsx(Z,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(q,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(we,{icon:t.jsx(Dt,{fontSize:"small"}),label:i,to:`/${i}`,selected:n.environmentName===i,isCollapsed:e},i)})})]})}function Qt({isCollapsed:e}){const r=[{label:"Malloy Docs",href:se.docsHome,icon:t.jsx(Ct,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:se.publishing,icon:t.jsx(Rt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(Mt,{fontSize:"small"}),external:!1}];return t.jsx(q,{sx:{py:1},children:r.map(n=>t.jsx(Ft,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))})}function we({icon:e,label:r,to:n,selected:o,isCollapsed:s}){const a=J(),i=t.jsxs(xe,{selected:o,onClick:c=>a(n,c),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(me,{sx:{minWidth:s?0:36,justifyContent:"center",color:o?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(ge,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(A,{title:r,placement:"right",children:t.jsx(m,{children:i})}):i}function Ft({label:e,href:r,icon:n,external:o,isCollapsed:s}){const a=t.jsxs(xe,{component:"a",href:r,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(me,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:n}),!s&&t.jsx(ge,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(A,{title:e,placement:"right",children:t.jsx(m,{children:a})}):a}function Xt({open:e,onClose:r,logoHeader:n}){return t.jsx(Et,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(ke,{isCollapsed:!1,onToggleCollapse:r,logoHeader:n})})}function Kt({headerProps:e}){const r=G(),n=Pt(r.breakpoints.up("md")),[o,s]=u.useState(!1),[a,i]=u.useState(!1);return u.useEffect(()=>{n&&o&&s(!1)},[n,o]),t.jsxs(m,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[n&&t.jsx(ke,{isCollapsed:a,onToggleCollapse:()=>i(c=>!c),logoHeader:e?.logoHeader}),t.jsxs(m,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(m,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Ke.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(m,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(N,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(_,{fontSize:"small"})})}),t.jsx(m,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Nt,{})}),t.jsxs(m,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx($t,{}),t.jsx(Ht,{}),e?.endCap]})]}),t.jsx(m,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(u.Suspense,{fallback:t.jsx(Ge,{}),children:t.jsx(Ze,{})})})]}),t.jsx(Xt,{open:o,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Kt as default};
|
|
1
|
+
import{u as Pe,g as Ce,R as Ie,r as u,a as ze,c as S,j as t,s as z,B as Me,m as G,e as ne,b as le,d as ce,h as de,i as De,k as U,l as pe,T as K,n as J,o as Te,p as Re,q as Be,t as ue,v as Le,w as He,x as oe,y as $e,z as Ne,A as W,C as $,D as Ae,P as Oe,E as We,F as Ve,S as Ue,G as Qe,H as A,I as N,J as Fe,K as he,L as fe,f as Z,N as m,O as Xe,Q as q,U as Ye,V as _e,$ as se,W as xe,X as me,Y as ge,Z as Ge,_ as Ke,a0 as Je}from"./index-BSBGZfIc.js";import{D as Ze,L as qe}from"./LightMode-DzUuDGQu.js";function et(e,r,n,o,s){const[a,i]=u.useState(()=>s&&n?n(e).matches:o?o(e).matches:r);return ze(()=>{if(!n)return;const c=n(e),h=()=>{i(c.matches)};return h(),c.addEventListener("change",h),()=>{c.removeEventListener("change",h)}},[e,n]),a}const tt={...Ie},ye=tt.useSyncExternalStore;function rt(e,r,n,o,s){const a=u.useCallback(()=>r,[r]),i=u.useMemo(()=>{if(s&&n)return()=>n(e).matches;if(o!==null){const{matches:p}=o(e);return()=>p}return a},[a,e,o,s,n]),[c,h]=u.useMemo(()=>{if(n===null)return[a,()=>()=>{}];const p=n(e);return[()=>p.matches,x=>(p.addEventListener("change",x),()=>{p.removeEventListener("change",x)})]},[a,n,e]);return ye(h,c,i)}function be(e={}){const{themeId:r}=e;return function(o,s={}){let a=Pe();a&&r&&(a=a[r]||a);const i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:c=!1,matchMedia:h=i?window.matchMedia:null,ssrMatchMedia:f=null,noSsr:p=!1}=Ce({name:"MuiUseMediaQuery",props:s,theme:a});let x=typeof o=="function"?o(a):o;return x=x.replace(/^@media( ?)/m,""),x.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
|
|
2
|
+
`)),(ye!==void 0?rt:et)(x,c,h,f,p)}}be();const nt=S(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),ot=z(Me,{name:"MuiBreadcrumbCollapsed"})(G(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:ne(e.palette.grey[200],.12)}:{backgroundColor:ne(e.palette.grey[600],.12)}}}))),st=z(nt)({width:24,height:16});function at(e){const{slots:r={},slotProps:n={},...o}=e,s=e;return t.jsx("li",{children:t.jsx(ot,{focusRipple:!0,...o,ownerState:s,children:t.jsx(st,{as:r.CollapsedIcon,ownerState:s,...n.collapsedIcon})})})}function it(e){return le("MuiBreadcrumbs",e)}const lt=ce("MuiBreadcrumbs",["root","ol","li","separator"]),ct=e=>{const{classes:r}=e;return pe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},it,r)},dt=z(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${lt.li}`]:r.li},r.root]})({}),pt=z("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ut=z("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ht(e,r,n,o){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(ut,{"aria-hidden":!0,className:r,ownerState:o,children:n},`separator-${i}`)):s.push(a),s),[])}const ft=u.forwardRef(function(r,n){const o=de({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:c={},slotProps:h={},expandText:f="Show path",itemsAfterCollapse:p=1,itemsBeforeCollapse:x=1,maxItems:y=8,separator:E="/",...H}=o,[M,P]=u.useState(!1),v={...o,component:i,expanded:M,expandText:f,itemsAfterCollapse:p,itemsBeforeCollapse:x,maxItems:y,separator:E},C=ct(v),D=De({elementType:c.CollapsedIcon,externalSlotProps:h.collapsedIcon,ownerState:v}),j=u.useRef(null),k=d=>{const w=()=>{P(!0);const b=j.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return x+p>=d.length?d:[...d.slice(0,x),t.jsx(at,{"aria-label":f,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:D},onClick:w},"ellipsis"),...d.slice(d.length-p,d.length)]},T=u.Children.toArray(s).filter(d=>u.isValidElement(d)).map((d,w)=>t.jsx("li",{className:C.li,children:d},`child-${w}`));return t.jsx(dt,{ref:n,component:i,color:"textSecondary",className:U(C.root,a),ownerState:v,...H,children:t.jsx(pt,{className:C.ol,ref:j,ownerState:v,children:ht(M||y&&T.length<=y?T:k(T),C.separator,E,v)})})});function xt(e,r,n){const o=r.getBoundingClientRect(),s=n&&n.getBoundingClientRect(),a=ue(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const f=a.getComputedStyle(r);i=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let c=0,h=0;if(i&&i!=="none"&&typeof i=="string"){const f=i.split("(")[1].split(")")[0].split(",");c=parseInt(f[4],10),h=parseInt(f[5],10)}return e==="left"?s?`translateX(${s.right+c-o.left}px)`:`translateX(${a.innerWidth+c-o.left}px)`:e==="right"?s?`translateX(-${o.right-s.left-c}px)`:`translateX(-${o.left+o.width-c}px)`:e==="up"?s?`translateY(${s.bottom+h-o.top}px)`:`translateY(${a.innerHeight+h-o.top}px)`:s?`translateY(-${o.top-s.top+o.height-h}px)`:`translateY(-${o.top+o.height-h}px)`}function mt(e){return typeof e=="function"?e():e}function V(e,r,n){const o=mt(n),s=xt(e,r,o);s&&(r.style.webkitTransform=s,r.style.transform=s)}const gt=u.forwardRef(function(r,n){const o=J(),s={enter:o.transitions.easing.easeOut,exit:o.transitions.easing.sharp},a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{addEndListener:i,appear:c=!0,children:h,container:f,direction:p="down",easing:x=s,in:y,onEnter:E,onEntered:H,onEntering:M,onExit:P,onExited:v,onExiting:C,style:D,timeout:j=a,TransitionComponent:k=Te,...T}=r,d=u.useRef(null),w=Re(Be(h),d,n),b=l=>g=>{l&&(g===void 0?l(d.current):l(d.current,g))},Q=b((l,g)=>{V(p,l,f),He(l),E&&E(l,g)}),ee=b((l,g)=>{const L=oe({timeout:j,style:D,easing:x},{mode:"enter"});l.style.webkitTransition=o.transitions.create("-webkit-transform",{...L}),l.style.transition=o.transitions.create("transform",{...L}),l.style.webkitTransform="none",l.style.transform="none",M&&M(l,g)}),R=b(H),B=b(C),I=b(l=>{const g=oe({timeout:j,style:D,easing:x},{mode:"exit"});l.style.webkitTransition=o.transitions.create("-webkit-transform",g),l.style.transition=o.transitions.create("transform",g),V(p,l,f),P&&P(l)}),F=b(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),X=l=>{i&&i(d.current,l)},O=u.useCallback(()=>{d.current&&V(p,d.current,f)},[p,f]);return u.useEffect(()=>{if(y||p==="down"||p==="right")return;const l=Le(()=>{d.current&&V(p,d.current,f)}),g=ue(d.current);return g.addEventListener("resize",l),()=>{l.clear(),g.removeEventListener("resize",l)}},[p,y,f]),u.useEffect(()=>{y||O()},[y,O]),t.jsx(k,{nodeRef:d,onEnter:Q,onEntered:R,onEntering:ee,onExit:I,onExited:F,onExiting:B,addEndListener:X,appear:c,in:y,timeout:j,...T,children:(l,{ownerState:g,...L})=>u.cloneElement(h,{ref:w,style:{visibility:l==="exited"&&!y?"hidden":void 0,...D,...h.props.style},...L})})});function yt(e){return le("MuiDrawer",e)}ce("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const ve=(e,r)=>{const{ownerState:n}=e;return[r.root,(n.variant==="permanent"||n.variant==="persistent")&&r.docked,r.modal]},bt=e=>{const{classes:r,anchor:n,variant:o}=e,s={root:["root",`anchor${$(n)}`],docked:[(o==="permanent"||o==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(n)}`,o!=="temporary"&&`paperAnchorDocked${$(n)}`]};return pe(s,yt,r)},vt=z(Ae,{name:"MuiDrawer",slot:"Root",overridesResolver:ve})(G(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),jt=z("div",{shouldForwardProp:We,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:ve})({flex:"0 0 auto"}),kt=z(Oe,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:n}=e;return[r.paper,r[`paperAnchor${$(n.anchor)}`],n.variant!=="temporary"&&r[`paperAnchorDocked${$(n.anchor)}`]]}})(G(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),je={left:"right",right:"left",top:"down",bottom:"up"};function wt(e){return["left","right"].includes(e)}function St({direction:e},r){return e==="rtl"&&wt(r)?je[r]:r}const Et=u.forwardRef(function(r,n){const o=de({props:r,name:"MuiDrawer"}),s=J(),a=$e(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:c="left",BackdropProps:h,children:f,className:p,elevation:x=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:E,...H}={},onClose:M,open:P=!1,PaperProps:v={},SlideProps:C,TransitionComponent:D,transitionDuration:j=i,variant:k="temporary",slots:T={},slotProps:d={},...w}=o,b=u.useRef(!1);u.useEffect(()=>{b.current=!0},[]);const Q=St({direction:a?"rtl":"ltr"},c),R={...o,anchor:c,elevation:x,open:P,variant:k,...w},B=bt(R),I={slots:{transition:D,...T},slotProps:{paper:v,transition:C,...d,backdrop:Ne(d.backdrop||{...h,...E},{transitionDuration:j})}},[F,X]=W("root",{ref:n,elementType:vt,className:U(B.root,B.modal,p),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...I,...w,...H},additionalProps:{open:P,onClose:M,hideBackdrop:y,slots:{backdrop:I.slots.backdrop},slotProps:{backdrop:I.slotProps.backdrop}}}),[O,l]=W("paper",{elementType:kt,shouldForwardComponentProp:!0,className:U(B.paper,v.className),ownerState:R,externalForwardedProps:I,additionalProps:{elevation:k==="temporary"?x:0,square:!0,...k==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[g,L]=W("docked",{elementType:jt,ref:n,className:U(B.root,B.docked,p),ownerState:R,externalForwardedProps:I,additionalProps:w}),[Se,Ee]=W("transition",{elementType:gt,ownerState:R,externalForwardedProps:I,additionalProps:{in:P,direction:je[Q],timeout:j,appear:b.current}}),te=t.jsx(O,{...l,children:f});if(k==="permanent")return t.jsx(g,{...L,children:te});const re=t.jsx(Se,{...Ee,children:te});return k==="persistent"?t.jsx(g,{...L,children:re}):t.jsx(F,{...X,children:re})}),Pt=be({themeId:Ve}),Ct=S([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),It=S(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),zt=S(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),Mt=S(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),Dt=S(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),Tt=S(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Rt=S(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Bt=S([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]);function _(e){return t.jsxs(Ue,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}const Lt={light:"dark",dark:"auto",auto:"light"},ae={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Ht(){const{mode:e,userChoice:r,setMode:n,allowUserToggle:o}=Qe();if(!o)return null;const s=r??e,a=Lt[s],i=s==="auto"?It:s==="dark"?Ze:qe;return t.jsx(A,{title:ae[s],children:t.jsx(N,{"aria-label":ae[s],onClick:()=>n(a),size:"small",children:t.jsx(i,{fontSize:"small"})})})}const ie="Visualization theme";function $t(){const e=Fe(),n=he().pathname.startsWith("/settings/theme");return t.jsx(A,{title:ie,children:t.jsx(N,{"aria-label":ie,onClick:()=>e("/settings/theme"),size:"small",color:n?"primary":"default",children:t.jsx(Bt,{fontSize:"small"})})})}function Y({label:e,onClick:r}){return t.jsx(Xe,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,sx:n=>({backgroundColor:"transparent",border:`1px solid ${n.palette.divider}`,color:"text.primary",fontWeight:500,fontSize:"0.875rem",height:32,cursor:"pointer",borderRadius:"4px",maxWidth:320,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:n.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function Nt(){const e=fe(),r=e["*"],n=Z();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(m,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(ft,{"aria-label":"breadcrumb",separator:t.jsx(zt,{sx:{fontSize:14,color:"text.secondary"}}),children:[e.environmentName&&t.jsx(Y,{label:e.environmentName,onClick:o=>n(`/${e.environmentName}/`,o)}),e.packageName&&t.jsx(Y,{label:e.packageName,onClick:o=>n(`/${e.environmentName}/${e.packageName}/`,o)}),r&&t.jsx(Y,{label:r,onClick:o=>n(`/${e.environmentName}/${e.packageName}/${r}`,o)})]})})}const At=260,Ot=64;function ke({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){return t.jsxs(m,{sx:{height:"100dvh",width:e?Ot:At,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Wt,{isCollapsed:e,onToggleCollapse:r,logoHeader:n}),t.jsxs(m,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Vt,{isCollapsed:e}),t.jsx(Ut,{isCollapsed:e})]}),t.jsx(Qt,{isCollapsed:e})]})}function Wt({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){const o=Z();return n?t.jsxs(m,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[n,t.jsx(N,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(_,{fontSize:"small"})})]}):t.jsxs(m,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(m,{onClick:s=>o("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(m,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(K,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(A,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(N,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(_,{fontSize:"small"})})})]})}function Vt({isCollapsed:e}){const n=he().pathname==="/";return t.jsx(q,{sx:{py:0},children:t.jsx(we,{icon:t.jsx(Tt,{fontSize:"small"}),label:"Home",to:"/",selected:n,isCollapsed:e})})}function Ut({isCollapsed:e}){const{apiClients:r}=Ye(),n=fe(),{data:o}=_e({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=o?.data??[];return s.length===0?null:t.jsxs(m,{sx:{mt:1},children:[!e&&t.jsx(K,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(q,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(we,{icon:t.jsx(Dt,{fontSize:"small"}),label:i,to:`/${i}`,selected:n.environmentName===i,isCollapsed:e},i)})})]})}function Qt({isCollapsed:e}){const r=[{label:"Malloy Docs",href:se.docsHome,icon:t.jsx(Ct,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:se.publishing,icon:t.jsx(Rt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(Mt,{fontSize:"small"}),external:!1}];return t.jsx(q,{sx:{py:1},children:r.map(n=>t.jsx(Ft,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))})}function we({icon:e,label:r,to:n,selected:o,isCollapsed:s}){const a=Z(),i=t.jsxs(xe,{selected:o,onClick:c=>a(n,c),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(me,{sx:{minWidth:s?0:36,justifyContent:"center",color:o?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(ge,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(A,{title:r,placement:"right",children:t.jsx(m,{children:i})}):i}function Ft({label:e,href:r,icon:n,external:o,isCollapsed:s}){const a=t.jsxs(xe,{component:"a",href:r,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(me,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:n}),!s&&t.jsx(ge,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(A,{title:e,placement:"right",children:t.jsx(m,{children:a})}):a}function Xt({open:e,onClose:r,logoHeader:n}){return t.jsx(Et,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(ke,{isCollapsed:!1,onToggleCollapse:r,logoHeader:n})})}function Gt({headerProps:e}){const r=J(),n=Pt(r.breakpoints.up("md")),[o,s]=u.useState(!1),[a,i]=u.useState(!1);return u.useEffect(()=>{n&&o&&s(!1)},[n,o]),t.jsxs(m,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[n&&t.jsx(ke,{isCollapsed:a,onToggleCollapse:()=>i(c=>!c),logoHeader:e?.logoHeader}),t.jsxs(m,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(m,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Ge.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(m,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(N,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(_,{fontSize:"small"})})}),t.jsx(m,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Nt,{})}),t.jsxs(m,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx($t,{}),t.jsx(Ht,{}),e?.endCap]})]}),t.jsx(m,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(u.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(Ke,{})})})]}),t.jsx(Xt,{open:o,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Gt as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-Dixkq2YH.js","assets/index-BSBGZfIc.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-B2KkD7kC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as _,j as a,f as b,r as u,a1 as k,J as y,K as N,a2 as W,N as i,a3 as h,a4 as C,a5 as U,a6 as F,a7 as g,a8 as E,a9 as L,a0 as R,aa as T,ab as D,L as I,U as S,ac as M,ad as O,ae as w,T as j,af as m,ag as z}from"./index-BSBGZfIc.js";const A=_(a.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}));function P(e,n){const s=b();return u.useCallback((t,l)=>{const c=new URLSearchParams(t.givens).toString(),o=encodeURIComponent(e),d=encodeURIComponent(n),x=encodeURIComponent(t.dashboard);s(`/${o}/${d}/dashboards/${x}`+(c?`?${c}`:""),l)},[s,e,n])}function G({environmentName:e,packageName:n,dashboardName:s}){const{params:t,onGivensChange:l}=k(),c=P(e,n),o=y(),{pathname:d}=N(),x=u.useMemo(()=>W({environmentName:e,packageName:n,dashboardName:s}),[e,n,s]);return u.useEffect(()=>{const p=()=>void E(()=>import("./index.es-Dixkq2YH.js"),__vite__mapDeps([0,1,2,3])),r=window.requestIdleCallback;if(r){const v=r(p);return()=>window.cancelIdleCallback?.(v)}const f=setTimeout(p,1500);return()=>clearTimeout(f)},[]),a.jsxs(i,{sx:{p:3,maxWidth:1600,mx:"auto"},children:[a.jsx(h,{label:n,href:`/${e}/${n}`,onClick:()=>o(`/${e}/${n}`)}),a.jsx(C,{children:a.jsx(U,{label:"Edit",icon:a.jsx(A,{}),onClick:()=>o(`${d.replace(/\/$/,"")}/edit`)})}),a.jsx(F,{resourceUri:g({environmentName:e,packageName:n}),dashboard:s,givens:t,onGivensChange:l,onNavigate:c,onEvent:x,maxResultSize:1024*1024})]})}const K=T.lazy(()=>E(()=>import("./index.es-Dixkq2YH.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.DashboardEditor})));function V({environmentName:e,packageName:n,dashboardName:s}){const t=y(),{pathname:l}=N(),c=l.replace(/\/edit\/?$/,""),o=u.useMemo(()=>W({environmentName:e,packageName:n,dashboardName:s}),[e,n,s]);return a.jsxs(i,{sx:{p:3,maxWidth:1600,mx:"auto"},children:[a.jsx(h,{label:n,href:`/${e}/${n}`,onClick:()=>t(`/${e}/${n}`)}),a.jsx(u.Suspense,{fallback:a.jsxs(L,{sx:{gap:2},children:[a.jsx(C,{}),a.jsx(R,{text:"Opening the builder…"})]}),children:a.jsx(K,{resourceUri:g({environmentName:e,packageName:n}),dashboard:s,onExit:()=>t(c),onEvent:o})})]})}function $({environmentName:e,packageName:n,notebookPath:s}){const{params:t,onGivensChange:l}=k(),c=P(e,n),o=b();return a.jsxs(i,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[a.jsx(h,{label:n,href:`/${e}/${n}`,onClick:d=>o(`/${e}/${n}`,d)}),a.jsx(D,{resourceUri:g({environmentName:e,packageName:n,modelPath:s}),maxResultSize:1024*1024,givens:t,onGivensChange:l,onNavigate:o,onDrillNavigate:c})]})}function B(){const e=I(),n=e["*"],{server:s}=S(),t=b(),{params:l,onGivensChange:c}=k();if(!e.environmentName)return a.jsx("div",{children:a.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return a.jsx("div",{children:a.jsx("h2",{children:"Missing package name"})});const o={p:3,maxWidth:1200,mx:"auto"};if(n?.startsWith("dashboards/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const r=n.slice(11);return r.endsWith("/edit")?a.jsx(V,{environmentName:e.environmentName,packageName:e.packageName,dashboardName:r.slice(0,-5)}):a.jsx(G,{environmentName:e.environmentName,packageName:e.packageName,dashboardName:r})}if(n?.startsWith("notebooks/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb"))return a.jsx($,{environmentName:e.environmentName,packageName:e.packageName,notebookPath:`${n}.malloy`});if(n?.startsWith("data-apps/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const r=n.slice(10),f=g({environmentName:e.environmentName,packageName:e.packageName,modelPath:r});return a.jsxs(i,{sx:o,children:[a.jsx(h,{label:e.packageName,href:`/${e.environmentName}/${e.packageName}`,onClick:v=>t(`/${e.environmentName}/${e.packageName}`,v)}),a.jsx(M,{resourceUri:f})]})}const d=g({environmentName:e.environmentName,packageName:e.packageName,modelPath:n});if(n?.endsWith(".malloy"))return a.jsxs(i,{sx:o,children:[a.jsx(h,{label:e.packageName,href:`/${e.environmentName}/${e.packageName}`,onClick:r=>t(`/${e.environmentName}/${e.packageName}`,r)}),a.jsx(O,{resourceUri:d,runOnDemand:!0,maxResultSize:512*1024,givens:l,onGivensChange:c})]});if(n?.endsWith(".malloynb"))return a.jsx($,{environmentName:e.environmentName,packageName:e.packageName,notebookPath:n});const x=/\.[^./]+$/.test(n??""),p=w({server:s,environmentName:e.environmentName,packageName:e.packageName,path:n??""});return a.jsxs(i,{sx:o,children:[a.jsx(h,{label:e.packageName,href:`/${e.environmentName}/${e.packageName}`,onClick:r=>t(`/${e.environmentName}/${e.packageName}`,r)}),a.jsx(j,{variant:"h6",sx:{fontWeight:600},children:"Nothing to open at this path"}),a.jsxs(j,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[a.jsx(i,{component:"span",sx:{fontFamily:m},children:n})," ","does not name a"," ",a.jsx(i,{component:"span",sx:{fontFamily:m},children:".malloy"})," ","or"," ",a.jsx(i,{component:"span",sx:{fontFamily:m},children:".malloynb"})," ","file in package"," ",a.jsx(i,{component:"span",sx:{fontFamily:m},children:e.packageName}),". This address opens"," ",a.jsx(i,{component:"span",sx:{fontFamily:m},children:".malloy"})," ","and"," ",a.jsx(i,{component:"span",sx:{fontFamily:m},children:".malloynb"})," ","files."]}),x&&a.jsxs(j,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",a.jsx(i,{component:"span",sx:{fontFamily:m},children:"public/"})," ","directory is served at ",a.jsx(z,{href:p,children:p}),"."]}),a.jsx(j,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its models, notebooks, and data apps."})]})}export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{L as r,f as t,j as e,a7 as c,ah as o}from"./index-BSBGZfIc.js";function f(){const{environmentName:a,packageName:n}=r(),s=t();if(a)if(n){const i=c({environmentName:a,packageName:n});return e.jsx(o,{onClickPackageFile:s,resourceUri:i})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{f as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{j as D,N as oe,r as p,az as ce,G as he,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-mS-LEGFh.js","assets/index-BSBGZfIc.js","assets/index-DUqldpo0.css","assets/index-w_0OQJgZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as D,N as oe,r as p,az as ce,G as he,n as ue,aA as me,ao as be,aB as H,a8 as G,aC as ye,aD as fe,aE as pe,aF as ge,aG as ae}from"./index-BSBGZfIc.js";const v="publisher-drill";function ve(e,r){const t=new Set;let o;try{o=e.getMetadata()?.getAllFields()??[]}catch{return t}const l=new Set;for(const a of o)!a||r(a)||a.tag?.tag("hidden")===void 0&&l.add(a.tag?.text("label")??a.name);for(const a of o){if(!a||!r(a))continue;const n=a.tag?.text("label")??a.name;l.has(n)||t.add(n)}return t}function M(e){const r=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return r?r[1]:void 0}function we(e,r){if(r.size!==0)for(const t of e.querySelectorAll(".malloy-table")){const o=n=>n.closest(".malloy-table")===t,l=new Set;for(const n of t.querySelectorAll(".column-cell.th")){if(!o(n))continue;const i=(n.textContent??"").replace(/\u200b/g,"").trim(),f=M(n);f&&r.has(i)&&l.add(f)}if(l.size===0)continue;const a=new Set;for(const n of t.querySelectorAll(`.${v}[tabindex="0"]`)){if(!o(n))continue;const i=M(n);i&&(a.has(i)?n.tabIndex=-1:a.add(i))}for(const n of t.querySelectorAll(".column-cell.td")){if(!o(n))continue;const i=M(n),f=!n.querySelector(".value-null")&&(n.textContent??"").trim()!=="";if(i&&f&&l.has(i)&&!n.querySelector(".malloy-table")){if(n.classList.add(v),n.tabIndex===0)a.add(i);else{const m=a.has(i);m||a.add(i),n.tabIndex=m?-1:0}n.setAttribute("role","button")}}}}function ke(e){const r=e.closest(".malloy-table"),t=M(e);return!r||!t?[]:Array.from(r.querySelectorAll(`.${v}`)).filter(o=>o.closest(".malloy-table")===r&&M(o)===t)}function ne(e,r){const t=ke(e),o=t.indexOf(e);if(o===-1)return;const l=r==="first"?t[0]:r==="last"?t[t.length-1]:t[Math.min(Math.max(o+r,0),t.length-1)];if(l){for(const a of t)a.tabIndex=a===l?0:-1;return l}}function xe(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function Ce(e){const{foreground:r,axisFaint:t,font:o}=e,l={background:e.background,font:o.family,title:{color:r,font:o.family},axis:{labelColor:r,titleColor:r,domainColor:t,tickColor:t,gridColor:t,labelFont:o.family,titleFont:o.family},legend:{labelColor:r,titleColor:r,labelFont:o.family,titleFont:o.family},header:{labelColor:r,titleColor:r},range:{category:e.series}};return a=>l}function Ee(e){if(!e)return;const r=e.tag("theme");if(!r)return;const t={},o=r.tag("palette");if(o){const a={},n=o.textArray("series");n&&n.length>0&&(a.series=n);for(const i of ce){const f=o.tag(i);if(!f)continue;const m={},w=f.text("light"),E=f.text("dark");w&&(m.light=w),E&&(m.dark=E),Object.keys(m).length>0&&(a[i]=m)}Object.keys(a).length>0&&(t.palette=a)}const l=r.tag("font");if(l){const a={},n=l.text("family");n&&(a.family=n);const i=l.numeric("size");typeof i=="number"&&Number.isFinite(i)&&(a.size=i),Object.keys(a).length>0&&(t.font=a)}return Object.keys(t).length>0?t:void 0}const Ae=async(e,r)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:t}=await G(async()=>{const{MalloyRenderer:o}=await import("./index-DSoCUF-f.js");return{MalloyRenderer:o}},[]);return new t({onClick:r,vegaConfigOverride:Ce(e),theme:xe(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};typeof window<"u"&&G(()=>import("./index-DSoCUF-f.js"),[]);async function Se(e){if(!e||typeof e!="object")return;const r=e,t=[...Array.isArray(r.model_annotations)?r.model_annotations:[],...Array.isArray(r.source_annotations)?r.source_annotations:[],...Array.isArray(r.annotations)?r.annotations:[]].map(l=>typeof l?.value=="string"?l.value:void 0).filter(l=>!!l);if(t.length===0)return;let o;try{({parseAnnotation:o}=await G(()=>import("./index-mS-LEGFh.js").then(l=>l.i),__vite__mapDeps([0,1,2,3])))}catch{return}try{const{tag:l}=o(t);return Ee(l)}catch(l){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:l,lines:t});return}}function _e(e,r,t){const o=ye(r,t);for(const[l,a]of Object.entries(o))e.style.setProperty(l,a)}const Re=`
|
|
3
3
|
/* Card geometry, through the renderer's OWN theme vars rather than over the top
|
|
4
4
|
of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
|
|
5
5
|
passes each through to the --malloy-render--* the card CSS reads, so a value
|
|
@@ -133,4 +133,4 @@ div.malloy-render .malloy-dashboard .dashboard-row-header {
|
|
|
133
133
|
color: var(--publisher-drill-link) !important;
|
|
134
134
|
text-decoration: underline;
|
|
135
135
|
}
|
|
136
|
-
`,le="publisher-malloy-renderer-overrides";function ze(){if(typeof document>"u"||document.getElementById(le))return;const e=document.createElement("style");e.id=le,e.textContent=Re,document.head.appendChild(e)}function Fe({result:e,height:r,drill:t,onSizeChange:o,onSizing:l}){const a=p.useRef(null),n=p.useRef(t);n.current=t;const i=p.useCallback(c=>{n.current?.onClick(c)},[]),f=t!==void 0,m=p.useRef(!1),w=p.useRef(null),E=p.useRef(0),{theme:J,layers:
|
|
136
|
+
`,le="publisher-malloy-renderer-overrides";function ze(){if(typeof document>"u"||document.getElementById(le))return;const e=document.createElement("style");e.id=le,e.textContent=Re,document.head.appendChild(e)}function Fe({result:e,height:r,drill:t,onSizeChange:o,onSizing:l}){const a=p.useRef(null),n=p.useRef(t);n.current=t;const i=p.useCallback(c=>{n.current?.onClick(c)},[]),f=t!==void 0,m=p.useRef(!1),w=p.useRef(null),E=p.useRef(0),{theme:J,layers:U,mode:X}=he(),Y=ue().shape.borderRadius,Z=p.useMemo(()=>({radius:`${Y}px`,padding:`${me}px`}),[Y]);return p.useEffect(()=>()=>{E.current+=1;const c=w.current;c?.viz.remove(),c?.node.remove(),w.current=null},[]),p.useLayoutEffect(()=>{if(!a.current||!e)return;ze();const c=a.current,se=E.current+=1;let P=!1;const N=()=>!P&&se===E.current;let d,b,B=null,q=0,L=null,$=null,I=null,F=null,O=null,T=null,K=null,W=0,A=null;m.current=!1;let g,S;const V=k=>{if(P||!k.firstElementChild||H(g,S)==="container")return;const j=fe(g,S);if(m.current&&!j)return;const x=pe(k,ae(g));x>0&&(m.current=!0,o&&x!==W&&(W=x,o(x)));const _=ge(k,ae(g));j&&_&&K!==_&&(K=_,T?.disconnect(),T=new ResizeObserver(()=>V(k)),T.observe(_))};return(async()=>{let k;try{k=JSON.parse(e)}catch(y){console.error("Error parsing visualization result:",y);return}const j=await Se(k),x=j?be([...U,j],X):J;if(!N())return;try{b=await Ae(x,i)}catch(y){console.error("Failed to create renderer:",y);return}if(!N()){b.remove(),b=void 0;return}const _=w.current;d=document.createElement("div"),d.style.width="100%",d.style.height="100%",_e(d,x,Z),c.childElementCount>0&&(c.style.position="relative",d.style.position="absolute",d.style.inset="0",d.style.visibility="hidden"),c.appendChild(d);const u=d;F=new MutationObserver(()=>{O&&clearTimeout(O),O=setTimeout(()=>{V(u),m.current&&F?.disconnect()},100)}),F.observe(d,{childList:!0,subtree:!0,attributes:!0});const ie=b;let Q=!1;const ee=()=>{if(!(Q||!N())){Q=!0,A&&(clearTimeout(A),A=null),_?.viz.remove();for(const y of Array.from(c.children))y!==u&&c.removeChild(y);u.style.position="",u.style.inset="",u.style.visibility="",c.style.position="",w.current={viz:ie,node:u},V(u)}};try{b.setResult(k);try{const C=b.getMetadata(),R=C?.getRootField();g=R?.renderAs(),S=R?C?.getPluginsForField(R.key)?.[0]?.sizingStrategy:void 0}catch{g=void 0,S=void 0}l?.(H(g,S)),d.dataset.malloyRenderAs=g??"unknown",d.dataset.malloySizing=H(g,S),b.render(d);const y=n.current;try{if(y){const C=ve(b,y.canDrill),R=()=>{try{we(u,C)}catch(s){console.warn("Drill affordance skipped:",s)}};R();const re=s=>{const h=s.querySelector(".cell-content")??s,z=h.getBoundingClientRect();h.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:h.ownerDocument.defaultView,clientX:Math.round(z.left+z.width/2),clientY:Math.round(z.bottom)}))},te=s=>s.target?.closest?.(`.${v}`)??null,de=(s,h)=>{ne(s,h)?.focus()};L=s=>{const h=te(s);if(!h)return;const z=s.key==="ArrowDown"?1:s.key==="ArrowUp"?-1:s.key==="Home"?"first":s.key==="End"?"last":void 0;if(z!==void 0){s.preventDefault(),de(h,z);return}s.key==="Enter"?(s.preventDefault(),re(h)):s.key===" "&&s.preventDefault()},$=s=>{if(s.key!==" ")return;const h=te(s);h&&(s.preventDefault(),re(h))},I=s=>{const h=s.target?.closest?.(`.${v}`);h&&ne(h,0)},u.addEventListener("keydown",L),u.addEventListener("keyup",$),u.addEventListener("focusin",I),C.size>0&&typeof MutationObserver<"u"&&(B=new MutationObserver(()=>{cancelAnimationFrame(q),q=requestAnimationFrame(R)}),B.observe(u,{childList:!0,subtree:!0}))}}catch(C){console.warn("Drill affordance skipped:",C)}b.onReady(ee),A=setTimeout(ee,1e4)}catch(y){console.error("Error rendering visualization:",y),F?.disconnect(),T?.disconnect(),B?.disconnect(),b.remove(),b=void 0,u.parentNode===c&&c.removeChild(u)}})(),()=>{P=!0,F?.disconnect(),T?.disconnect(),O&&clearTimeout(O),A&&clearTimeout(A),d&&w.current?.node!==d&&(L&&d.removeEventListener("keydown",L),$&&d.removeEventListener("keyup",$),I&&d.removeEventListener("focusin",I),B?.disconnect(),cancelAnimationFrame(q),b?.remove(),d.parentNode===c&&c.removeChild(d),c.style.position="")}},[e,i,f,o,l,J,U,X,Z]),D.jsx("div",{ref:a,style:{width:"100%",height:r?`${r}px`:"400px"}})}function Oe(e){return typeof window>"u"?D.jsx(oe,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):D.jsx(p.Suspense,{fallback:D.jsx(oe,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:D.jsx(Fe,{...e})})}const je=Object.freeze(Object.defineProperty({__proto__:null,default:Oe},Symbol.toStringTag,{value:"Module"}));export{v as D,Oe as R,Ce as a,xe as b,je as c,ve as d,we as m,Ee as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aj as o,j as r,ak as s,a9 as n,N as t,T as a}from"./index-BSBGZfIc.js";function x(){const e=o();return console.error(e),r.jsx(s,{maxWidth:"lg",component:"main",sx:{display:"flex",flexDirection:"column",my:2,gap:0},children:r.jsxs(n,{sx:{m:"auto",flexDirection:"column"},children:[r.jsx(t,{sx:{height:"300px"}}),r.jsx("img",{src:"/error.png"}),r.jsx(a,{variant:"subtitle1",children:"An unexpected error occurred"})]})})}export{x as default};
|