From feef3450b7abe50d41cbabc3f36cf3c344be9633 Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Wed, 17 Apr 2024 07:54:53 +0100 Subject: [PATCH] example section --- .../subjects/DatesAsNumbers.svelte | 30 ++++++++---- .../subjects/ScalarJsonOnly.svelte | 20 +++----- .../subjects/StringsAsNumbers.svelte | 46 ++++++++++++------- .../subjects/components/Block.svelte | 1 + .../subjects/components/ExampleLine.svelte | 12 +++++ .../subjects/components/ExampleSection.svelte | 31 +++++++++++++ .../subjects/components/Section.svelte | 4 -- .../subjects/components/index.js | 2 + .../lines/JSONPrimitivesOnly.svelte | 1 + 9 files changed, 104 insertions(+), 43 deletions(-) create mode 100644 packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/ExampleLine.svelte create mode 100644 packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/ExampleSection.svelte diff --git a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/DatesAsNumbers.svelte b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/DatesAsNumbers.svelte index 0c851d77a2..3effc88640 100644 --- a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/DatesAsNumbers.svelte +++ b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/DatesAsNumbers.svelte @@ -1,6 +1,6 @@ @@ -7,19 +7,33 @@ Text can be used in place of numbers in certain scenarios, but care needs to be taken, as text that doesn't contain a strictly base-ten integer or decimal value may lead to unexpected behavior. -
- Examples: -
- "100"{" -> "}100 -
- "100k"{" -> "}100 -
- "100,000"{" -> "}100 -
- "100 million"{" -> "}100 -
- "100.9"{" -> "}100.9 -
- "One hundred"{" -> "}Error -
+ + + "100"{"->"}100 + + + "100k"{"->"}100 + + + "100,000"{"->"}100 + + + "100 million"{"->"}100 + + + "100.9"{"->"}100.9 + + + "One hundred"{"->"}Error + +
+ + diff --git a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/Block.svelte b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/Block.svelte index 761abfbdc8..6ee93ff1a6 100644 --- a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/Block.svelte +++ b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/Block.svelte @@ -2,6 +2,7 @@ export let truncate = false export let noShrink = false + diff --git a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/ExampleLine.svelte b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/ExampleLine.svelte new file mode 100644 index 0000000000..f72417354c --- /dev/null +++ b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/ExampleLine.svelte @@ -0,0 +1,12 @@ +
  • +
    + +
    +
  • + + diff --git a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/ExampleSection.svelte b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/ExampleSection.svelte new file mode 100644 index 0000000000..fa5fd8e081 --- /dev/null +++ b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/ExampleSection.svelte @@ -0,0 +1,31 @@ + + +
    + + + {heading} + + + +
    + + diff --git a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/Section.svelte b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/Section.svelte index 3bc3ec945d..486e111725 100644 --- a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/Section.svelte +++ b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/Section.svelte @@ -8,8 +8,4 @@ margin-bottom: 13px; overflow: hidden; } - - .section :global(ul) { - padding-left: 24px; - } diff --git a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/index.js b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/index.js index 4fde1de91f..d174f4d6cc 100644 --- a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/index.js +++ b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/components/index.js @@ -4,3 +4,5 @@ export { default as JSONValue } from "./JSONValue.svelte" export { default as BindingValue } from "./BindingValue.svelte" export { default as Section } from "./Section.svelte" export { default as Block } from "./Block.svelte" +export { default as ExampleSection } from "./ExampleSection.svelte" +export { default as ExampleLine } from "./ExampleLine.svelte" diff --git a/packages/builder/src/components/design/settings/controls/FieldContext/lines/JSONPrimitivesOnly.svelte b/packages/builder/src/components/design/settings/controls/FieldContext/lines/JSONPrimitivesOnly.svelte index 5b27a3142a..ee4b258b80 100644 --- a/packages/builder/src/components/design/settings/controls/FieldContext/lines/JSONPrimitivesOnly.svelte +++ b/packages/builder/src/components/design/settings/controls/FieldContext/lines/JSONPrimitivesOnly.svelte @@ -9,6 +9,7 @@ setExplanationSubject(subjects.scalarJsonOnly)} + on:mouseleave={() => setExplanationSubject(subjects.none)} >Scalar JSON values