@lowdefy/blocks-basic 0.0.0-experimental-20261003193825 → 0.0.0-experimental-20261006081525

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.
@@ -55,6 +55,13 @@
55
55
  displayType: 'yaml'
56
56
  }
57
57
  },
58
+ pathParams: {
59
+ type: 'object',
60
+ description: "Values for the placeholders in the path of the page given by pageId, like `{ ticket_id: '1234' }` for `tickets/{ticket_id}`.",
61
+ docs: {
62
+ displayType: 'yaml'
63
+ }
64
+ },
58
65
  disabled: {
59
66
  type: 'boolean',
60
67
  default: false,
@@ -46,6 +46,15 @@ blocks:
46
46
  href: https://lowdefy.com
47
47
  newTab: true
48
48
 
49
+ - id: anchor_path_params
50
+ type: Anchor
51
+ properties:
52
+ title: Ticket
53
+ pageId: anchor-path-target
54
+ pathParams:
55
+ space: support
56
+ ticket_id: 1234
57
+
49
58
  - id: anchor_clickable
50
59
  type: Anchor
51
60
  properties:
@@ -0,0 +1,23 @@
1
+ # Copyright 2020-2026 Lowdefy, Inc
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # The page with a patterned path that the pathParams link tests open.
16
+ id: anchor-path-target
17
+ path: anchor-tickets/{space}/{ticket_id}
18
+ type: Box
19
+ blocks:
20
+ - id: anchor_path_target
21
+ type: Span
22
+ properties:
23
+ content: Path target
@@ -0,0 +1,57 @@
1
+ # Copyright 2020-2026 Lowdefy, Inc
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # A page whose title reads state that is set after mount, once per page instance.
16
+ id: box-page-title
17
+ path: box-page-title/{record}
18
+ type: Box
19
+ properties:
20
+ title:
21
+ _if_none:
22
+ - _state: record_title
23
+ - Record
24
+ events:
25
+ onMount:
26
+ - id: wait_before_title
27
+ type: Wait
28
+ params:
29
+ ms: 300
30
+ - id: set_record_title
31
+ type: SetState
32
+ params:
33
+ record_title:
34
+ _string.concat:
35
+ - 'Record '
36
+ - _path_params: record
37
+ blocks:
38
+ - id: rename_record
39
+ type: Anchor
40
+ properties:
41
+ title: Rename record
42
+ events:
43
+ onClick:
44
+ - id: set_renamed_title
45
+ type: SetState
46
+ params:
47
+ record_title:
48
+ _string.concat:
49
+ - 'Renamed '
50
+ - _path_params: record
51
+ - id: open_record_b
52
+ type: Anchor
53
+ properties:
54
+ title: Open record b
55
+ pageId: box-page-title
56
+ pathParams:
57
+ record: b
@@ -32,7 +32,7 @@
32
32
  },
33
33
  {
34
34
  id: 'html-hardcoded-links',
35
- message: 'Link to app pages with <a data-page-id="page-id" data-url-query="key=value">, not <a href="/page-id?key=value">. A hard-coded href reloads the whole app on click, ignores basePath and is not checked by the build. Use data-new-tab, not target="_blank", which sanitising removes.',
35
+ message: 'Link to app pages with <a data-page-id="page-id" data-url-query="key=value"> (and data-path-params=\'{"name":"value"}\' for a page whose path has placeholders), not <a href="/page-id?key=value">. A hard-coded href reloads the whole app on click, ignores basePath and is not checked by the build. Use data-new-tab, not target="_blank", which sanitising removes.',
36
36
  see: 'concepts/html-attributes'
37
37
  },
38
38
  {
@@ -50,7 +50,7 @@
50
50
  properties: {
51
51
  html: {
52
52
  type: 'string',
53
- description: 'Content to be rendered as Html. It understands these attributes: data-icon="edit" renders an icon (a semantic name like edit, delete or warning, or a Lucide icon name like Pencil); data-tooltip="Text" shows a tooltip on hover and focus; data-popover="id" toggles a popover showing the element with data-popover-content="id" (mark it hidden); <a data-page-id="page-id" data-url-query="key=value"> links to an app page without reloading (never hard-code href="/page"); data-link opts an existing app-relative <a href="/path"> into the same navigation; data-new-tab opens a link in a new tab (target is stripped by sanitising); data-tag="success" renders a tinted status tag and data-status="success" a status dot (tones success, processing, info, warning, error, default, an antd preset colour, a CSS colour, or any other value to seed a stable colour); <time datetime="ISO" data-time="relative"> renders a date as relative, date, datetime, time or a dayjs format; data-format="currency" data-currency="USD" formats the element\'s number as number, currency, percent, compact or bytes; data-avatar="Jane Doe" renders initials (on an <img>, a fallback for a broken image; never use an avatar image service); data-copy adds a copy button for the element\'s text or the attribute\'s value; data-truncate="2" clamps block text to 1–6 lines with the full text in a tooltip when cut off; data-tone="secondary" colours text with a theme tone (secondary, tertiary, quaternary, success, warning, error, info). See the HTML attributes docs page.',
53
+ description: 'Content to be rendered as Html. It understands these attributes: data-icon="edit" renders an icon (a semantic name like edit, delete or warning, or a Lucide icon name like Pencil); data-tooltip="Text" shows a tooltip on hover and focus; data-popover="id" toggles a popover showing the element with data-popover-content="id" (mark it hidden); <a data-page-id="page-id" data-url-query="key=value"> links to an app page without reloading (never hard-code href="/page"), with data-path-params=\'{"name":"value"}\' (a JSON object) for a page whose path has placeholders; data-link opts an existing app-relative <a href="/path"> into the same navigation; data-new-tab opens a link in a new tab (target is stripped by sanitising); data-tag="success" renders a tinted status tag and data-status="success" a status dot (tones success, processing, info, warning, error, default, an antd preset colour, a CSS colour, or any other value to seed a stable colour); <time datetime="ISO" data-time="relative"> renders a date as relative, date, datetime, time or a dayjs format; data-format="currency" data-currency="USD" formats the element\'s number as number, currency, percent, compact or bytes; data-avatar="Jane Doe" renders initials (on an <img>, a fallback for a broken image; never use an avatar image service); data-copy adds a copy button for the element\'s text or the attribute\'s value; data-truncate="2" clamps block text to 1–6 lines with the full text in a tooltip when cut off; data-tone="secondary" colours text with a theme tone (secondary, tertiary, quaternary, success, warning, error, info). See the HTML attributes docs page.',
54
54
  docs: {
55
55
  displayType: 'text-area'
56
56
  }
@@ -64,5 +64,6 @@ blocks:
64
64
  <span id="enh_popover" data-popover="more">More</span>
65
65
  <div data-popover-content="more" hidden><b class="enh-popover-body">Popover body</b></div>
66
66
  <a id="enh_page_link" data-page-id="clickablehtml" data-url-query="tab=a">Clickable</a>
67
+ <a id="enh_path_link" data-page-id="anchor-path-target" data-path-params='{"space":"s","ticket_id":"1"}'>Ticket</a>
67
68
  <a id="enh_dot_link" href="/.//evil.example/x" data-link>Dot link</a>
68
69
  <span id="enh_copy_long" data-copy="npm install lowdefy-package-with-a-long-name --save-dev">Install</span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/blocks-basic",
3
- "version": "0.0.0-experimental-20261003193825",
3
+ "version": "0.0.0-experimental-20261006081525",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Basic html Lowdefy blocks.",
6
6
  "homepage": "https://lowdefy.com",
@@ -45,17 +45,17 @@
45
45
  "dist/*"
46
46
  ],
47
47
  "dependencies": {
48
- "@lowdefy/block-utils": "0.0.0-experimental-20261003193825",
49
- "@lowdefy/helpers": "0.0.0-experimental-20261003193825",
50
- "dompurify": "3.4.13"
48
+ "@lowdefy/block-utils": "0.0.0-experimental-20261006081525",
49
+ "@lowdefy/helpers": "0.0.0-experimental-20261006081525",
50
+ "dompurify": "3.4.16"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "react": ">=18",
54
54
  "react-dom": ">=18"
55
55
  },
56
56
  "devDependencies": {
57
- "@lowdefy/block-dev-e2e": "0.0.0-experimental-20261003193825",
58
- "@lowdefy/e2e-utils": "0.0.0-experimental-20261003193825",
57
+ "@lowdefy/block-dev-e2e": "0.0.0-experimental-20261006081525",
58
+ "@lowdefy/e2e-utils": "0.0.0-experimental-20261006081525",
59
59
  "@playwright/test": "1.59.1",
60
60
  "@swc/cli": "0.8.1",
61
61
  "@swc/core": "1.15.32",