@graview/core 0.1.28 → 0.1.29
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/README.md +17 -0
- package/dist/amount-input.d.ts +21 -0
- package/dist/amount-input.d.ts.map +1 -0
- package/dist/amount-input.js +96 -0
- package/dist/amount-input.js.map +1 -0
- package/dist/answer-seen.d.ts +38 -0
- package/dist/answer-seen.d.ts.map +1 -0
- package/dist/answer-seen.js +122 -0
- package/dist/answer-seen.js.map +1 -0
- package/dist/app-places.d.ts +56 -0
- package/dist/app-places.d.ts.map +1 -0
- package/dist/app-places.js +153 -0
- package/dist/app-places.js.map +1 -0
- package/dist/arrange.d.ts +2 -2
- package/dist/arrange.d.ts.map +1 -1
- package/dist/arrange.js +2 -2
- package/dist/arrange.js.map +1 -1
- package/dist/arrangement-words.d.ts +3 -0
- package/dist/arrangement-words.d.ts.map +1 -0
- package/dist/arrangement-words.js +50 -0
- package/dist/arrangement-words.js.map +1 -0
- package/dist/arrangement.d.ts +25 -3
- package/dist/arrangement.d.ts.map +1 -1
- package/dist/arrangement.js +36 -32
- package/dist/arrangement.js.map +1 -1
- package/dist/arranging.d.ts.map +1 -1
- package/dist/arranging.js +19 -8
- package/dist/arranging.js.map +1 -1
- package/dist/bind.d.ts +3 -0
- package/dist/bind.d.ts.map +1 -1
- package/dist/bind.js.map +1 -1
- package/dist/capabilities.js +1 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/check.d.ts +3 -0
- package/dist/check.d.ts.map +1 -1
- package/dist/check.js +3 -0
- package/dist/check.js.map +1 -1
- package/dist/city.d.ts +58 -50
- package/dist/city.d.ts.map +1 -1
- package/dist/city.js +160 -147
- package/dist/city.js.map +1 -1
- package/dist/cli/check/brand.js +1 -1
- package/dist/cli/check/brand.js.map +1 -1
- package/dist/cli/check/clock-rules.d.ts +4 -0
- package/dist/cli/check/clock-rules.d.ts.map +1 -0
- package/dist/cli/check/clock-rules.js +26 -0
- package/dist/cli/check/clock-rules.js.map +1 -0
- package/dist/cli/check/field-sight.d.ts +11 -0
- package/dist/cli/check/field-sight.d.ts.map +1 -0
- package/dist/cli/check/field-sight.js +113 -0
- package/dist/cli/check/field-sight.js.map +1 -0
- package/dist/cli/check/index.d.ts +2 -0
- package/dist/cli/check/index.d.ts.map +1 -1
- package/dist/cli/check/index.js +2 -0
- package/dist/cli/check/index.js.map +1 -1
- package/dist/cli/check/lenses.d.ts +1 -1
- package/dist/cli/check/lenses.d.ts.map +1 -1
- package/dist/cli/check/lenses.js +43 -2
- package/dist/cli/check/lenses.js.map +1 -1
- package/dist/cli/check/relations.d.ts.map +1 -1
- package/dist/cli/check/relations.js +2 -1
- package/dist/cli/check/relations.js.map +1 -1
- package/dist/cli/check.d.ts.map +1 -1
- package/dist/cli/check.js +7 -4
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/describe.d.ts.map +1 -1
- package/dist/cli/describe.js +44 -3
- package/dist/cli/describe.js.map +1 -1
- package/dist/cli/docs.d.ts.map +1 -1
- package/dist/cli/docs.js +4 -3
- package/dist/cli/docs.js.map +1 -1
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/types.js +10 -1
- package/dist/cli/types.js.map +1 -1
- package/dist/clock-readers.d.ts +18 -0
- package/dist/clock-readers.d.ts.map +1 -0
- package/dist/clock-readers.js +70 -0
- package/dist/clock-readers.js.map +1 -0
- package/dist/clock.d.ts +30 -0
- package/dist/clock.d.ts.map +1 -0
- package/dist/clock.js +41 -0
- package/dist/clock.js.map +1 -0
- package/dist/columns.d.ts.map +1 -1
- package/dist/columns.js +2 -1
- package/dist/columns.js.map +1 -1
- package/dist/conformance/fixtures.d.ts.map +1 -1
- package/dist/conformance/fixtures.js +326 -43
- package/dist/conformance/fixtures.js.map +1 -1
- package/dist/days.d.ts +53 -4
- package/dist/days.d.ts.map +1 -1
- package/dist/days.js +136 -16
- package/dist/days.js.map +1 -1
- package/dist/describe.d.ts +1 -0
- package/dist/describe.d.ts.map +1 -1
- package/dist/describe.js +1 -0
- package/dist/describe.js.map +1 -1
- package/dist/document/act-findings.d.ts.map +1 -1
- package/dist/document/act-findings.js +13 -3
- package/dist/document/act-findings.js.map +1 -1
- package/dist/document/amount.d.ts +4 -0
- package/dist/document/amount.d.ts.map +1 -0
- package/dist/document/amount.js +22 -0
- package/dist/document/amount.js.map +1 -0
- package/dist/document/block-context.d.ts.map +1 -1
- package/dist/document/block-context.js +1 -0
- package/dist/document/block-context.js.map +1 -1
- package/dist/document/blocks.d.ts +13 -3
- package/dist/document/blocks.d.ts.map +1 -1
- package/dist/document/blocks.js +56 -12
- package/dist/document/blocks.js.map +1 -1
- package/dist/document/compile-checked.d.ts.map +1 -1
- package/dist/document/compile-checked.js +3 -2
- package/dist/document/compile-checked.js.map +1 -1
- package/dist/document/compile.d.ts.map +1 -1
- package/dist/document/compile.js +30 -7
- package/dist/document/compile.js.map +1 -1
- package/dist/document/compiled.d.ts +4 -2
- package/dist/document/compiled.d.ts.map +1 -1
- package/dist/document/compiled.js +50 -19
- package/dist/document/compiled.js.map +1 -1
- package/dist/document/describe-coverage.d.ts.map +1 -1
- package/dist/document/describe-coverage.js +2 -1
- package/dist/document/describe-coverage.js.map +1 -1
- package/dist/document/describe-place.d.ts +6 -2
- package/dist/document/describe-place.d.ts.map +1 -1
- package/dist/document/describe-place.js +14 -8
- package/dist/document/describe-place.js.map +1 -1
- package/dist/document/diff.d.ts +2 -0
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +34 -6
- package/dist/document/diff.js.map +1 -1
- package/dist/document/durations.d.ts +8 -0
- package/dist/document/durations.d.ts.map +1 -0
- package/dist/document/durations.js +82 -0
- package/dist/document/durations.js.map +1 -0
- package/dist/document/edit.d.ts +1 -1
- package/dist/document/edit.d.ts.map +1 -1
- package/dist/document/edit.js +195 -22
- package/dist/document/edit.js.map +1 -1
- package/dist/document/expr/evaluate.d.ts +1 -1
- package/dist/document/expr/evaluate.d.ts.map +1 -1
- package/dist/document/expr/evaluate.js +17 -4
- package/dist/document/expr/evaluate.js.map +1 -1
- package/dist/document/field-spec.d.ts.map +1 -1
- package/dist/document/field-spec.js +15 -1
- package/dist/document/field-spec.js.map +1 -1
- package/dist/document/format-findings.d.ts +4 -0
- package/dist/document/format-findings.d.ts.map +1 -0
- package/dist/document/format-findings.js +39 -0
- package/dist/document/format-findings.js.map +1 -0
- package/dist/document/format-rules.d.ts +8 -0
- package/dist/document/format-rules.d.ts.map +1 -0
- package/dist/document/format-rules.js +19 -0
- package/dist/document/format-rules.js.map +1 -0
- package/dist/document/format-words.d.ts +9 -0
- package/dist/document/format-words.d.ts.map +1 -0
- package/dist/document/format-words.js +29 -0
- package/dist/document/format-words.js.map +1 -0
- package/dist/document/graview-template.d.ts +2 -2
- package/dist/document/migrate.d.ts +1 -0
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +45 -1
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/money.d.ts +14 -0
- package/dist/document/money.d.ts.map +1 -0
- package/dist/document/money.js +14 -0
- package/dist/document/money.js.map +1 -0
- package/dist/document/policy-words.d.ts +2 -0
- package/dist/document/policy-words.d.ts.map +1 -1
- package/dist/document/policy-words.js +19 -4
- package/dist/document/policy-words.js.map +1 -1
- package/dist/document/rule-line.d.ts.map +1 -1
- package/dist/document/rule-line.js +16 -12
- package/dist/document/rule-line.js.map +1 -1
- package/dist/document/rules.d.ts.map +1 -1
- package/dist/document/rules.js +6 -5
- package/dist/document/rules.js.map +1 -1
- package/dist/document/schema.d.ts +62 -19
- package/dist/document/schema.d.ts.map +1 -1
- package/dist/document/schema.js +30 -4
- package/dist/document/schema.js.map +1 -1
- package/dist/document/template-parse.d.ts.map +1 -1
- package/dist/document/template-parse.js +9 -2
- package/dist/document/template-parse.js.map +1 -1
- package/dist/document/template.d.ts +3 -13
- package/dist/document/template.d.ts.map +1 -1
- package/dist/document/template.js +24 -22
- package/dist/document/template.js.map +1 -1
- package/dist/document/thumbnail.d.ts.map +1 -1
- package/dist/document/thumbnail.js +4 -3
- package/dist/document/thumbnail.js.map +1 -1
- package/dist/document/to-document.d.ts +0 -1
- package/dist/document/to-document.d.ts.map +1 -1
- package/dist/document/to-document.js +19 -2
- package/dist/document/to-document.js.map +1 -1
- package/dist/document/view-specs.d.ts.map +1 -1
- package/dist/document/view-specs.js +3 -0
- package/dist/document/view-specs.js.map +1 -1
- package/dist/document/views.d.ts +2 -0
- package/dist/document/views.d.ts.map +1 -1
- package/dist/document/views.js +18 -6
- package/dist/document/views.js.map +1 -1
- package/dist/document.schema.json +63 -6
- package/dist/excerpt-of.d.ts +14 -0
- package/dist/excerpt-of.d.ts.map +1 -0
- package/dist/excerpt-of.js +120 -0
- package/dist/excerpt-of.js.map +1 -0
- package/dist/excerpt.d.ts +9 -0
- package/dist/excerpt.d.ts.map +1 -0
- package/dist/excerpt.js +43 -0
- package/dist/excerpt.js.map +1 -0
- package/dist/field-sight.d.ts +33 -0
- package/dist/field-sight.d.ts.map +1 -0
- package/dist/field-sight.js +313 -0
- package/dist/field-sight.js.map +1 -0
- package/dist/forms.d.ts +1 -0
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +1 -0
- package/dist/forms.js.map +1 -1
- package/dist/graph/archived.d.ts +25 -0
- package/dist/graph/archived.d.ts.map +1 -0
- package/dist/graph/archived.js +16 -0
- package/dist/graph/archived.js.map +1 -0
- package/dist/graph/diff.d.ts.map +1 -1
- package/dist/graph/diff.js +2 -1
- package/dist/graph/diff.js.map +1 -1
- package/dist/graph/graph.d.ts +37 -13
- package/dist/graph/graph.d.ts.map +1 -1
- package/dist/graph/graph.js +86 -40
- package/dist/graph/graph.js.map +1 -1
- package/dist/graph/tracked.d.ts +8 -8
- package/dist/graph/tracked.d.ts.map +1 -1
- package/dist/graph/tracked.js +15 -20
- package/dist/graph/tracked.js.map +1 -1
- package/dist/graph/types.d.ts +16 -8
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/graph/types.js.map +1 -1
- package/dist/import/coerce.d.ts +45 -0
- package/dist/import/coerce.d.ts.map +1 -0
- package/dist/import/coerce.js +252 -0
- package/dist/import/coerce.js.map +1 -0
- package/dist/import/csv.d.ts +16 -0
- package/dist/import/csv.d.ts.map +1 -0
- package/dist/import/csv.js +77 -0
- package/dist/import/csv.js.map +1 -0
- package/dist/import/index.d.ts +17 -0
- package/dist/import/index.d.ts.map +1 -0
- package/dist/import/index.js +13 -0
- package/dist/import/index.js.map +1 -0
- package/dist/import/mapping.d.ts +99 -0
- package/dist/import/mapping.d.ts.map +1 -0
- package/dist/import/mapping.js +182 -0
- package/dist/import/mapping.js.map +1 -0
- package/dist/import/rows.d.ts +116 -0
- package/dist/import/rows.d.ts.map +1 -0
- package/dist/import/rows.js +584 -0
- package/dist/import/rows.js.map +1 -0
- package/dist/index.d.ts +38 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -16
- package/dist/index.js.map +1 -1
- package/dist/invariants/engine.d.ts +5 -1
- package/dist/invariants/engine.d.ts.map +1 -1
- package/dist/invariants/engine.js +4 -3
- package/dist/invariants/engine.js.map +1 -1
- package/dist/invariants/types.d.ts +18 -3
- package/dist/invariants/types.d.ts.map +1 -1
- package/dist/json-schema.d.ts +1 -0
- package/dist/json-schema.d.ts.map +1 -1
- package/dist/json-schema.js +2 -0
- package/dist/json-schema.js.map +1 -1
- package/dist/labels.d.ts.map +1 -1
- package/dist/labels.js +2 -1
- package/dist/labels.js.map +1 -1
- package/dist/lines.d.ts +1 -0
- package/dist/lines.d.ts.map +1 -1
- package/dist/lines.js +5 -3
- package/dist/lines.js.map +1 -1
- package/dist/markdown.d.ts +102 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +460 -0
- package/dist/markdown.js.map +1 -0
- package/dist/mutations/arg-shape.d.ts +95 -0
- package/dist/mutations/arg-shape.d.ts.map +1 -0
- package/dist/mutations/arg-shape.js +101 -0
- package/dist/mutations/arg-shape.js.map +1 -0
- package/dist/mutations/define-mutation.d.ts +48 -2
- package/dist/mutations/define-mutation.d.ts.map +1 -1
- package/dist/mutations/define-mutation.js +103 -36
- package/dist/mutations/define-mutation.js.map +1 -1
- package/dist/mutations/derive-edits.d.ts +16 -1
- package/dist/mutations/derive-edits.d.ts.map +1 -1
- package/dist/mutations/derive-edits.js +67 -28
- package/dist/mutations/derive-edits.js.map +1 -1
- package/dist/mutations/derive-repeats.d.ts +8 -0
- package/dist/mutations/derive-repeats.d.ts.map +1 -0
- package/dist/mutations/derive-repeats.js +118 -0
- package/dist/mutations/derive-repeats.js.map +1 -0
- package/dist/mutations/derived-names.d.ts +20 -0
- package/dist/mutations/derived-names.d.ts.map +1 -0
- package/dist/mutations/derived-names.js +19 -0
- package/dist/mutations/derived-names.js.map +1 -0
- package/dist/mutations/form.d.ts +21 -1
- package/dist/mutations/form.d.ts.map +1 -1
- package/dist/mutations/form.js +19 -2
- package/dist/mutations/form.js.map +1 -1
- package/dist/mutations/invalid-arguments.d.ts +14 -0
- package/dist/mutations/invalid-arguments.d.ts.map +1 -0
- package/dist/mutations/invalid-arguments.js +18 -0
- package/dist/mutations/invalid-arguments.js.map +1 -0
- package/dist/mutations/keep-link.d.ts +27 -0
- package/dist/mutations/keep-link.d.ts.map +1 -0
- package/dist/mutations/keep-link.js +56 -0
- package/dist/mutations/keep-link.js.map +1 -0
- package/dist/mutations/kept-arguments.d.ts +26 -0
- package/dist/mutations/kept-arguments.d.ts.map +1 -0
- package/dist/mutations/kept-arguments.js +77 -0
- package/dist/mutations/kept-arguments.js.map +1 -0
- package/dist/mutations/node-ref.d.ts +0 -80
- package/dist/mutations/node-ref.d.ts.map +1 -1
- package/dist/mutations/node-ref.js +0 -93
- package/dist/mutations/node-ref.js.map +1 -1
- package/dist/mutations/types.d.ts +17 -1
- package/dist/mutations/types.d.ts.map +1 -1
- package/dist/mutations/words.d.ts +0 -13
- package/dist/mutations/words.d.ts.map +1 -1
- package/dist/mutations/words.js +1 -12
- package/dist/mutations/words.js.map +1 -1
- package/dist/ops/kept-fields.d.ts +7 -0
- package/dist/ops/kept-fields.d.ts.map +1 -0
- package/dist/ops/kept-fields.js +24 -0
- package/dist/ops/kept-fields.js.map +1 -0
- package/dist/ops/lineage.d.ts +37 -0
- package/dist/ops/lineage.d.ts.map +1 -0
- package/dist/ops/lineage.js +26 -0
- package/dist/ops/lineage.js.map +1 -0
- package/dist/ops/log.d.ts.map +1 -1
- package/dist/ops/log.js +1 -0
- package/dist/ops/log.js.map +1 -1
- package/dist/ops/provenance.d.ts +68 -0
- package/dist/ops/provenance.d.ts.map +1 -0
- package/dist/ops/provenance.js +83 -0
- package/dist/ops/provenance.js.map +1 -0
- package/dist/ops/types.d.ts +25 -0
- package/dist/ops/types.d.ts.map +1 -1
- package/dist/ops/withheld.d.ts +25 -2
- package/dist/ops/withheld.d.ts.map +1 -1
- package/dist/ops/withheld.js +6 -15
- package/dist/ops/withheld.js.map +1 -1
- package/dist/permissions/policy.d.ts +6 -1
- package/dist/permissions/policy.d.ts.map +1 -1
- package/dist/permissions/policy.js +29 -9
- package/dist/permissions/policy.js.map +1 -1
- package/dist/permissions/sight.d.ts +40 -2
- package/dist/permissions/sight.d.ts.map +1 -1
- package/dist/permissions/sight.js +25 -2
- package/dist/permissions/sight.js.map +1 -1
- package/dist/permissions/types.d.ts +21 -0
- package/dist/permissions/types.d.ts.map +1 -1
- package/dist/permissions/types.js.map +1 -1
- package/dist/places.d.ts +0 -49
- package/dist/places.d.ts.map +1 -1
- package/dist/places.js +2 -141
- package/dist/places.js.map +1 -1
- package/dist/provenance.d.ts +14 -0
- package/dist/provenance.d.ts.map +1 -0
- package/dist/provenance.js +13 -0
- package/dist/provenance.js.map +1 -0
- package/dist/repeat-words.d.ts +13 -0
- package/dist/repeat-words.d.ts.map +1 -0
- package/dist/repeat-words.js +56 -0
- package/dist/repeat-words.js.map +1 -0
- package/dist/repeat.d.ts +59 -0
- package/dist/repeat.d.ts.map +1 -0
- package/dist/repeat.js +155 -0
- package/dist/repeat.js.map +1 -0
- package/dist/scaffold/project.d.ts.map +1 -1
- package/dist/scaffold/project.js +13 -0
- package/dist/scaffold/project.js.map +1 -1
- package/dist/scaffold/ui.js +2 -2
- package/dist/scene-districts.d.ts +2 -1
- package/dist/scene-districts.d.ts.map +1 -1
- package/dist/scene-districts.js +2 -1
- package/dist/scene-districts.js.map +1 -1
- package/dist/scene.d.ts +4 -2
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +2 -1
- package/dist/scene.js.map +1 -1
- package/dist/schema/amount-mark.d.ts +13 -0
- package/dist/schema/amount-mark.d.ts.map +1 -0
- package/dist/schema/amount-mark.js +20 -0
- package/dist/schema/amount-mark.js.map +1 -0
- package/dist/schema/amount-words.d.ts +12 -0
- package/dist/schema/amount-words.d.ts.map +1 -0
- package/dist/schema/amount-words.js +31 -0
- package/dist/schema/amount-words.js.map +1 -0
- package/dist/schema/app-link-field.d.ts +4 -0
- package/dist/schema/app-link-field.d.ts.map +1 -0
- package/dist/schema/app-link-field.js +19 -0
- package/dist/schema/app-link-field.js.map +1 -0
- package/dist/schema/app-link.d.ts +41 -0
- package/dist/schema/app-link.d.ts.map +1 -0
- package/dist/schema/app-link.js +40 -0
- package/dist/schema/app-link.js.map +1 -0
- package/dist/schema/define-node.d.ts +25 -94
- package/dist/schema/define-node.d.ts.map +1 -1
- package/dist/schema/define-node.js +3 -247
- package/dist/schema/define-node.js.map +1 -1
- package/dist/schema/field-words.d.ts +45 -0
- package/dist/schema/field-words.d.ts.map +1 -0
- package/dist/schema/field-words.js +124 -0
- package/dist/schema/field-words.js.map +1 -0
- package/dist/schema/json-schema.d.ts +6 -1
- package/dist/schema/json-schema.d.ts.map +1 -1
- package/dist/schema/json-schema.js +83 -2
- package/dist/schema/json-schema.js.map +1 -1
- package/dist/schema/markdown-field.d.ts +4 -0
- package/dist/schema/markdown-field.d.ts.map +1 -0
- package/dist/schema/markdown-field.js +20 -0
- package/dist/schema/markdown-field.js.map +1 -0
- package/dist/schema/markdown.d.ts +6 -0
- package/dist/schema/markdown.d.ts.map +1 -0
- package/dist/schema/markdown.js +27 -0
- package/dist/schema/markdown.js.map +1 -0
- package/dist/schema/reading.d.ts +86 -0
- package/dist/schema/reading.d.ts.map +1 -0
- package/dist/schema/reading.js +270 -0
- package/dist/schema/reading.js.map +1 -0
- package/dist/schema/repeat-field.d.ts +5 -0
- package/dist/schema/repeat-field.d.ts.map +1 -0
- package/dist/schema/repeat-field.js +20 -0
- package/dist/schema/repeat-field.js.map +1 -0
- package/dist/schema/schema.d.ts.map +1 -1
- package/dist/schema/schema.js +5 -1
- package/dist/schema/schema.js.map +1 -1
- package/dist/schema/to-json-schema.d.ts +14 -0
- package/dist/schema/to-json-schema.d.ts.map +1 -0
- package/dist/schema/to-json-schema.js +616 -0
- package/dist/schema/to-json-schema.js.map +1 -0
- package/dist/schema/typed-field-builders.d.ts +8 -0
- package/dist/schema/typed-field-builders.d.ts.map +1 -0
- package/dist/schema/typed-field-builders.js +30 -0
- package/dist/schema/typed-field-builders.js.map +1 -0
- package/dist/schema/typed-field-of.d.ts +4 -0
- package/dist/schema/typed-field-of.d.ts.map +1 -0
- package/dist/schema/typed-field-of.js +14 -0
- package/dist/schema/typed-field-of.js.map +1 -0
- package/dist/schema/typed-fields.d.ts +11 -0
- package/dist/schema/typed-fields.d.ts.map +1 -0
- package/dist/schema/typed-fields.js +16 -0
- package/dist/schema/typed-fields.js.map +1 -0
- package/dist/schema/types.d.ts +14 -0
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/value-words.d.ts +21 -0
- package/dist/schema/value-words.d.ts.map +1 -0
- package/dist/schema/value-words.js +32 -0
- package/dist/schema/value-words.js.map +1 -0
- package/dist/search.d.ts +91 -4
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +288 -53
- package/dist/search.js.map +1 -1
- package/dist/seat.d.ts +19 -0
- package/dist/seat.d.ts.map +1 -0
- package/dist/seat.js +19 -0
- package/dist/seat.js.map +1 -0
- package/dist/seen.d.ts +15 -33
- package/dist/seen.d.ts.map +1 -1
- package/dist/seen.js +44 -135
- package/dist/seen.js.map +1 -1
- package/dist/store.d.ts +46 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +121 -22
- package/dist/store.js.map +1 -1
- package/dist/theme/types.d.ts +7 -1
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/theme/types.js.map +1 -1
- package/dist/typed.d.ts +12 -3
- package/dist/typed.d.ts.map +1 -1
- package/dist/typed.js.map +1 -1
- package/dist/validate-graph.d.ts.map +1 -1
- package/dist/validate-graph.js +3 -10
- package/dist/validate-graph.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/views/types.d.ts +57 -8
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/types.js +22 -3
- package/dist/views/types.js.map +1 -1
- package/dist/village.d.ts +63 -0
- package/dist/village.d.ts.map +1 -0
- package/dist/village.js +143 -0
- package/dist/village.js.map +1 -0
- package/dist/watched.d.ts +12 -45
- package/dist/watched.d.ts.map +1 -1
- package/dist/watched.js +7 -119
- package/dist/watched.js.map +1 -1
- package/dist/words.d.ts +33 -0
- package/dist/words.d.ts.map +1 -0
- package/dist/words.js +36 -0
- package/dist/words.js.map +1 -0
- package/package.json +37 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unpkg.com/@graview/core@0.1.
|
|
4
|
-
"title": "Graview declaration document, format 1 (@graview/core 0.1.
|
|
3
|
+
"$id": "https://unpkg.com/@graview/core@0.1.29/dist/document.schema.json",
|
|
4
|
+
"title": "Graview declaration document, format 1 (@graview/core 0.1.29)",
|
|
5
5
|
"description": "A whole Graview app as one JSON object: its kinds, fields, relations, acts, rules, roles, views and brand. `graview check --document <file>` compiles it and says what is wrong in words; this schema is the same shape, for an editor. Name it in a document's \"$schema\".",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
@@ -97,7 +97,11 @@
|
|
|
97
97
|
"url",
|
|
98
98
|
"email",
|
|
99
99
|
"image",
|
|
100
|
-
"file"
|
|
100
|
+
"file",
|
|
101
|
+
"app-link",
|
|
102
|
+
"phone",
|
|
103
|
+
"place",
|
|
104
|
+
"duration"
|
|
101
105
|
]
|
|
102
106
|
},
|
|
103
107
|
"required": {
|
|
@@ -143,7 +147,8 @@
|
|
|
143
147
|
"enum": [
|
|
144
148
|
"money",
|
|
145
149
|
"percent",
|
|
146
|
-
"duration"
|
|
150
|
+
"duration",
|
|
151
|
+
"markdown"
|
|
147
152
|
]
|
|
148
153
|
},
|
|
149
154
|
"min": {
|
|
@@ -158,6 +163,9 @@
|
|
|
158
163
|
"renamedFrom": {
|
|
159
164
|
"type": "string",
|
|
160
165
|
"pattern": "^[a-z][A-Za-z0-9]*$"
|
|
166
|
+
},
|
|
167
|
+
"repeats": {
|
|
168
|
+
"type": "boolean"
|
|
161
169
|
}
|
|
162
170
|
},
|
|
163
171
|
"required": [
|
|
@@ -496,6 +504,10 @@
|
|
|
496
504
|
},
|
|
497
505
|
"people": {
|
|
498
506
|
"type": "boolean"
|
|
507
|
+
},
|
|
508
|
+
"archives": {
|
|
509
|
+
"type": "boolean",
|
|
510
|
+
"const": false
|
|
499
511
|
}
|
|
500
512
|
},
|
|
501
513
|
"required": [
|
|
@@ -820,7 +832,11 @@
|
|
|
820
832
|
"url",
|
|
821
833
|
"email",
|
|
822
834
|
"image",
|
|
823
|
-
"file"
|
|
835
|
+
"file",
|
|
836
|
+
"app-link",
|
|
837
|
+
"phone",
|
|
838
|
+
"place",
|
|
839
|
+
"duration"
|
|
824
840
|
]
|
|
825
841
|
},
|
|
826
842
|
"required": {
|
|
@@ -866,7 +882,8 @@
|
|
|
866
882
|
"enum": [
|
|
867
883
|
"money",
|
|
868
884
|
"percent",
|
|
869
|
-
"duration"
|
|
885
|
+
"duration",
|
|
886
|
+
"markdown"
|
|
870
887
|
]
|
|
871
888
|
},
|
|
872
889
|
"min": {
|
|
@@ -881,6 +898,9 @@
|
|
|
881
898
|
"renamedFrom": {
|
|
882
899
|
"type": "string",
|
|
883
900
|
"pattern": "^[a-z][A-Za-z0-9]*$"
|
|
901
|
+
},
|
|
902
|
+
"repeats": {
|
|
903
|
+
"type": "boolean"
|
|
884
904
|
}
|
|
885
905
|
},
|
|
886
906
|
"required": [
|
|
@@ -1425,6 +1445,22 @@
|
|
|
1425
1445
|
"via": {
|
|
1426
1446
|
"type": "string",
|
|
1427
1447
|
"pattern": "^(?:[a-z][a-z0-9]*(?:-[a-z0-9]+)*|[a-z][A-Za-z0-9]*)$"
|
|
1448
|
+
},
|
|
1449
|
+
"fields": {
|
|
1450
|
+
"minItems": 1,
|
|
1451
|
+
"type": "array",
|
|
1452
|
+
"items": {
|
|
1453
|
+
"type": "string",
|
|
1454
|
+
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
|
|
1455
|
+
}
|
|
1456
|
+
},
|
|
1457
|
+
"hide": {
|
|
1458
|
+
"minItems": 1,
|
|
1459
|
+
"type": "array",
|
|
1460
|
+
"items": {
|
|
1461
|
+
"type": "string",
|
|
1462
|
+
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
|
|
1463
|
+
}
|
|
1428
1464
|
}
|
|
1429
1465
|
},
|
|
1430
1466
|
"required": [
|
|
@@ -1493,6 +1529,27 @@
|
|
|
1493
1529
|
"type": "string",
|
|
1494
1530
|
"minLength": 1,
|
|
1495
1531
|
"maxLength": 40
|
|
1532
|
+
},
|
|
1533
|
+
"lists": {
|
|
1534
|
+
"type": "object",
|
|
1535
|
+
"propertyNames": {
|
|
1536
|
+
"type": "string"
|
|
1537
|
+
},
|
|
1538
|
+
"additionalProperties": {
|
|
1539
|
+
"type": "object",
|
|
1540
|
+
"properties": {
|
|
1541
|
+
"filters": {
|
|
1542
|
+
"maxItems": 40,
|
|
1543
|
+
"type": "array",
|
|
1544
|
+
"items": {
|
|
1545
|
+
"type": "string",
|
|
1546
|
+
"minLength": 1,
|
|
1547
|
+
"maxLength": 120
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
},
|
|
1551
|
+
"additionalProperties": false
|
|
1552
|
+
}
|
|
1496
1553
|
}
|
|
1497
1554
|
},
|
|
1498
1555
|
"additionalProperties": {}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A TEXT'S START, as a list, a card, a row, a describe line, a table cell
|
|
3
|
+
* or a search hit says it (FR-180): its first block — paragraph, heading
|
|
4
|
+
* or item — or about `most` characters (160) of it, the first sentence
|
|
5
|
+
* where that fits; an ellipsis after where words were left out mid-thought;
|
|
6
|
+
* Markdown's syntax taken out when `markdown` says the text is Markdown.
|
|
7
|
+
*/
|
|
8
|
+
export declare function excerptOf(text: string, options?: {
|
|
9
|
+
readonly markdown?: boolean | undefined;
|
|
10
|
+
readonly most?: number | undefined;
|
|
11
|
+
}): string;
|
|
12
|
+
/** Markdown said as words, whole: every block's words in a line, the syntax taken out — what a search finds by and shows a fragment of. */
|
|
13
|
+
export declare const markdownWords: (text: string) => string;
|
|
14
|
+
//# sourceMappingURL=excerpt-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excerpt-of.d.ts","sourceRoot":"","sources":["../src/excerpt-of.ts"],"names":[],"mappings":"AAkGA;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAO,GAAG,MAAM,CAO7I;AAED,2IAA2I;AAC3I,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,MAAyE,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { firstSentence } from "./excerpt.js";
|
|
2
|
+
/*
|
|
3
|
+
* A LONG TEXT'S START AT A GLANCE (FR-180): what a list, a card, a row, a
|
|
4
|
+
* describe line, a table cell and a seat's line say of a record's prose.
|
|
5
|
+
* The record's page says it whole.
|
|
6
|
+
*
|
|
7
|
+
* What is said is the text's FIRST BLOCK — its first paragraph, heading or
|
|
8
|
+
* list item, its lines run together — and of that the first sentence when
|
|
9
|
+
* the block is too long, else its words up to the most allowed, with an
|
|
10
|
+
* ellipsis wherever words were left out mid-thought. Markdown's syntax is
|
|
11
|
+
* taken out (FR-180): "## Heading **bold**" is said "Heading bold", a link
|
|
12
|
+
* is its words, code its letters. How many LINES that draws in is the
|
|
13
|
+
* surface's to clamp; this decides only WHAT text is shown.
|
|
14
|
+
*/
|
|
15
|
+
// Each reads one line and is linear in it.
|
|
16
|
+
const HEADING = /^ {0,3}#{1,6}(?:[ \t]+|$)/;
|
|
17
|
+
const LIST_ITEM = /^[ \t]*(?:[-*+•]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/;
|
|
18
|
+
const RULE = /^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/;
|
|
19
|
+
const FENCE = /^ {0,3}(?:`{3,}|~{3,})/;
|
|
20
|
+
const QUOTE = /^ {0,3}(?:>[ \t]?)+/;
|
|
21
|
+
// Read on a trimmed line, so no two runs of spaces meet.
|
|
22
|
+
const TABLE_RULE = /^\|?\s*:?-{2,}:?\s*(?:\|\s*:?-{2,}:?\s*)*\|?$/;
|
|
23
|
+
const ENTITIES = { amp: "&", lt: "<", gt: ">", quot: '"', "#39": "'", nbsp: " " };
|
|
24
|
+
/** One line of Markdown said as words: emphasis, code, links, tags and escapes taken out. */
|
|
25
|
+
function inlineWords(line) {
|
|
26
|
+
return line
|
|
27
|
+
.replace(/!?\[([^\]\n]{0,500})\]\([^)\n]{0,500}\)/g, "$1")
|
|
28
|
+
.replace(/<((?:https?:|mailto:)[^>\s]*)>/gi, "$1")
|
|
29
|
+
.replace(/<\/?[A-Za-z][^<>\n]*>/g, "")
|
|
30
|
+
.replace(/`+([^`\n]*)`+/g, "$1")
|
|
31
|
+
.replace(/(\*\*|__|~~)(?=\S)([^\n]{0,500}?\S)\1/g, "$2")
|
|
32
|
+
.replace(/(^|[^\w*])\*(?=\S)([^*\n]{0,500}?\S)\*(?![\w*])/g, "$1$2")
|
|
33
|
+
.replace(/(^|\W)_(?=\S)([^_\n]{0,500}?\S)_(?!\w)/g, "$1$2")
|
|
34
|
+
.replace(/\\([\\`*_{}[\]()#+\-.!>|~])/g, "$1")
|
|
35
|
+
.replace(/&(amp|lt|gt|quot|#39|nbsp);/g, (_, name) => ENTITIES[name] ?? "");
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The text's blocks — paragraphs, headings and list items — each its lines
|
|
39
|
+
* run together and its syntax taken out, read until `enough` characters are
|
|
40
|
+
* had; and whether any text is left after the last one read.
|
|
41
|
+
*/
|
|
42
|
+
function blocksOf(text, markdown, enough) {
|
|
43
|
+
const lines = text.replace(/\r\n?/g, "\n").split("\n");
|
|
44
|
+
const blocks = [];
|
|
45
|
+
let taken = [];
|
|
46
|
+
let had = 0;
|
|
47
|
+
let fenced = false;
|
|
48
|
+
const close = () => {
|
|
49
|
+
const block = taken.join(" ").replace(/\s+/g, " ").trim();
|
|
50
|
+
if (block) {
|
|
51
|
+
blocks.push(block);
|
|
52
|
+
had += block.length;
|
|
53
|
+
}
|
|
54
|
+
taken = [];
|
|
55
|
+
};
|
|
56
|
+
let next = 0;
|
|
57
|
+
while (next < lines.length && had <= enough) {
|
|
58
|
+
let line = lines[next++];
|
|
59
|
+
if (markdown && FENCE.test(line)) {
|
|
60
|
+
fenced = !fenced;
|
|
61
|
+
if (!fenced)
|
|
62
|
+
close();
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (!fenced && (line.trim().length === 0 || (markdown && (RULE.test(line) || TABLE_RULE.test(line.trim()))))) {
|
|
66
|
+
close();
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const heading = !fenced && markdown && HEADING.test(line);
|
|
70
|
+
const item = !fenced && LIST_ITEM.test(line);
|
|
71
|
+
// A heading or a list item is a block of its own: the paragraph before it ends there.
|
|
72
|
+
if (heading || item)
|
|
73
|
+
close();
|
|
74
|
+
if (markdown && !fenced) {
|
|
75
|
+
line = line.replace(QUOTE, "");
|
|
76
|
+
if (heading)
|
|
77
|
+
line = line.replace(HEADING, "").replace(/[ \t]+#+[ \t]*$/, "");
|
|
78
|
+
if (item)
|
|
79
|
+
line = line.replace(LIST_ITEM, "");
|
|
80
|
+
if (line.includes("|"))
|
|
81
|
+
line = line.replace(/^[ \t]*\||\|[ \t]*$/g, "").split("|").map((cell) => cell.trim()).filter(Boolean).join(" · ");
|
|
82
|
+
// A glance reads no further than it says: a 20,000-character line is not stripped whole for 160 of it.
|
|
83
|
+
line = inlineWords(Number.isFinite(enough) ? line.slice(0, enough * 2 + 200) : line);
|
|
84
|
+
}
|
|
85
|
+
else if (item)
|
|
86
|
+
line = line.replace(LIST_ITEM, "");
|
|
87
|
+
taken.push(line);
|
|
88
|
+
if (heading)
|
|
89
|
+
close();
|
|
90
|
+
// A very long block is read only as far as any excerpt says.
|
|
91
|
+
if (taken.reduce((sum, one) => sum + one.length, 0) > enough)
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
close();
|
|
95
|
+
return { blocks, more: lines.slice(next).some((line) => line.trim().length > 0 && !(markdown && (FENCE.test(line) || RULE.test(line)))) };
|
|
96
|
+
}
|
|
97
|
+
/** Cuts words to at most `most` characters, at a word's end, with an ellipsis. */
|
|
98
|
+
function cut(flat, most) {
|
|
99
|
+
const kept = flat.slice(0, most + 1).replace(/\s+\S*$/, "");
|
|
100
|
+
return `${(kept || flat.slice(0, most)).replace(/[\s,;:.—-]+$/, "")}…`;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A TEXT'S START, as a list, a card, a row, a describe line, a table cell
|
|
104
|
+
* or a search hit says it (FR-180): its first block — paragraph, heading
|
|
105
|
+
* or item — or about `most` characters (160) of it, the first sentence
|
|
106
|
+
* where that fits; an ellipsis after where words were left out mid-thought;
|
|
107
|
+
* Markdown's syntax taken out when `markdown` says the text is Markdown.
|
|
108
|
+
*/
|
|
109
|
+
export function excerptOf(text, options = {}) {
|
|
110
|
+
const most = options.most ?? 160;
|
|
111
|
+
const { blocks, more } = blocksOf(text, options.markdown === true, most);
|
|
112
|
+
const first = blocks[0] ?? "";
|
|
113
|
+
if (first.length <= most)
|
|
114
|
+
return (more || blocks.length > 1) && first.length > 0 && !/[.!?…:]$/.test(first) ? `${first}…` : first;
|
|
115
|
+
const sentence = firstSentence(first);
|
|
116
|
+
return sentence && sentence.length <= most ? sentence : cut(first, most);
|
|
117
|
+
}
|
|
118
|
+
/** Markdown said as words, whole: every block's words in a line, the syntax taken out — what a search finds by and shows a fragment of. */
|
|
119
|
+
export const markdownWords = (text) => blocksOf(text, true, Number.POSITIVE_INFINITY).blocks.join(" ");
|
|
120
|
+
//# sourceMappingURL=excerpt-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excerpt-of.js","sourceRoot":"","sources":["../src/excerpt-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;;;;;;GAYG;AAEH,2CAA2C;AAC3C,MAAM,OAAO,GAAG,2BAA2B,CAAC;AAC5C,MAAM,SAAS,GAAG,yDAAyD,CAAC;AAC5E,MAAM,IAAI,GAAG,8DAA8D,CAAC;AAC5E,MAAM,KAAK,GAAG,wBAAwB,CAAC;AACvC,MAAM,KAAK,GAAG,qBAAqB,CAAC;AACpC,yDAAyD;AACzD,MAAM,UAAU,GAAG,+CAA+C,CAAC;AACnE,MAAM,QAAQ,GAAqC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAA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,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The first sentence: up to the first stop that ends one — not an abbreviation's, and not before three words. */
|
|
2
|
+
export declare function firstSentence(flat: string): string | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* A long text's start: its first sentence when that is short enough, else its
|
|
5
|
+
* words up to `most` characters and an ellipsis — a line's heading or quote
|
|
6
|
+
* mark, bold and code ticks, and a link's address left out (FR-180).
|
|
7
|
+
*/
|
|
8
|
+
export declare function excerpt(text: string, most?: number): string;
|
|
9
|
+
//# sourceMappingURL=excerpt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"excerpt.d.ts","sourceRoot":"","sources":["../src/excerpt.ts"],"names":[],"mappings":"AAgBA,kHAAkH;AAClH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS9D;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,SAAM,GAAG,MAAM,CAOxD"}
|
package/dist/excerpt.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A LONG TEXT'S START, for a card, a row or a glance: what `{summary|excerpt}`
|
|
3
|
+
* says. The record's page says it whole. A page's first load carries this
|
|
4
|
+
* (a template may ask for it), so it takes out only Markdown's commonest
|
|
5
|
+
* marks; a glance reads prose through `excerptOf` (excerpt-of.ts), fetched
|
|
6
|
+
* with what reads a record, which takes out the rest (FR-180).
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A stop that ends an abbreviation, not a sentence: "e.g.", "U.S.", "Ph.D.",
|
|
10
|
+
* "Dr." — short letters between stops, or a title. A word with a stop
|
|
11
|
+
* inside it that is not that ("capabilities().shipped.", "graview.dev.")
|
|
12
|
+
* ends its sentence.
|
|
13
|
+
*/
|
|
14
|
+
const ABBREVIATION = /^[("'“‘]*(?:(?:[a-z]{1,3}\.){2,}|(?:dr|mr|mrs|ms|mx|st|mt|vs|jr|sr|prof|no|fig|approx)\.)$/i;
|
|
15
|
+
/** The first sentence: up to the first stop that ends one — not an abbreviation's, and not before three words. */
|
|
16
|
+
export function firstSentence(flat) {
|
|
17
|
+
for (const stop of flat.matchAll(/[.!?](?=\s|$)/g)) {
|
|
18
|
+
const sentence = flat.slice(0, stop.index + 1);
|
|
19
|
+
const word = /\S+$/.exec(sentence)?.[0] ?? "";
|
|
20
|
+
if (stop[0] === "." && ABBREVIATION.test(word))
|
|
21
|
+
continue;
|
|
22
|
+
if (sentence.split(" ").length < 3 && stop.index + 1 < flat.length)
|
|
23
|
+
continue;
|
|
24
|
+
return sentence;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A long text's start: its first sentence when that is short enough, else its
|
|
30
|
+
* words up to `most` characters and an ellipsis — a line's heading or quote
|
|
31
|
+
* mark, bold and code ticks, and a link's address left out (FR-180).
|
|
32
|
+
*/
|
|
33
|
+
export function excerpt(text, most = 140) {
|
|
34
|
+
const flat = text.replace(/^[#>\s]+|\*\*|`|\](\([^)\s]*\))?|\[/gm, "").replace(/\s+/g, " ").trim();
|
|
35
|
+
const sentence = firstSentence(flat);
|
|
36
|
+
if (sentence && sentence.length <= most)
|
|
37
|
+
return sentence;
|
|
38
|
+
if (flat.length <= most)
|
|
39
|
+
return flat;
|
|
40
|
+
const cut = flat.slice(0, most + 1).replace(/\s+\S*$/, "");
|
|
41
|
+
return `${(cut || flat.slice(0, most)).replace(/[\s,;:.—-]+$/, "")}…`;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=excerpt.js.map
|
|
@@ -0,0 +1 @@
|
|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rC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC3D,OAAO,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,GAAG,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export { withoutKeptFields } from "./ops/kept-fields.js";
|
|
2
|
+
import { type FieldsKept, type Records } from "./permissions/sight.js";
|
|
3
|
+
import type { Policy, Principal } from "./permissions/types.js";
|
|
4
|
+
import type { Judged } from "./seen.js";
|
|
5
|
+
/** The edges a graph can be asked about, to say what is joined to whom. */
|
|
6
|
+
interface Joined {
|
|
7
|
+
out(id: string, kind?: string): readonly {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
}[];
|
|
10
|
+
in(id: string, kind?: string): readonly {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
14
|
+
type Node = {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly kind: string;
|
|
17
|
+
};
|
|
18
|
+
/** The kinds some sight shows only some fields of: the only kinds a field is ever kept from. */
|
|
19
|
+
export declare function partialKinds(policy: Policy | undefined): ReadonlySet<string>;
|
|
20
|
+
/**
|
|
21
|
+
* WHICH FIELDS OF A RECORD IT SEES a principal may not: a test that says
|
|
22
|
+
* yes of a field kept from it, or undefined when it sees every field. A
|
|
23
|
+
* field is shown when any sight that shows the principal the record shows
|
|
24
|
+
* it, so one sight with neither `fields` nor `hide` shows them all.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fieldsKept(policy: Policy | undefined, principal: Principal, node: Node, graph: Joined, records?: Pick<Records, "creatorOf">): ((field: string) => boolean) | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* THE FIELDS OF EACH RECORD ONE SEAT MAY NOT SEE, as the store judges them
|
|
29
|
+
* now; undefined when no sight shows only some fields. A record no log has
|
|
30
|
+
* made yet is judged the asking seat's own, as it will be once it makes it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function keptFrom(store: Judged, principal: Principal): FieldsKept | undefined;
|
|
33
|
+
//# sourceMappingURL=field-sight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-sight.d.ts","sourceRoot":"","sources":["../src/field-sight.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAKzD,OAAO,EAAwC,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC7G,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAS,MAAM,wBAAwB,CAAC;AAGvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,2EAA2E;AAC3E,UAAU,MAAM;IACd,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnE,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnE;AAED,KAAK,IAAI,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAM3D,gGAAgG;AAChG,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,CAK5E;AAiBD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,SAAS,EAA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