Loading...
Loading...
Compare original and translation side by side
<iframe>$shell.open<referenceName>Dialog(...)<iframe>$shell.open<referenceName>Dialog(...)data:configurationTypeIdiframeConfig.href_embed-embed$embed$shell$datasources$utilsmoduleIddata:configurationTypeIdiframeConfig.href_embed-embed$embed$shell$datasources$utilsmoduleIdrequirements-gatheringform-creatorcomponent-wiring-checkconfigParametersinParamsrequirements-gatheringform-creatorcomponent-wiring-checkconfigParametersinParamsdxs configurationdxs embedembedconfigurationTypeId: 20undefineddxs configurationdxs embedembedconfigurationTypeId: 20undefined
**Edit an existing embed:**
```bash
**编辑现有embed:**
```bashundefinedundefineddxs configuration upsertjq .json envelope.json > body.jsondxs configuration upsertjq .json envelope.json > body.json[Phase 1: Setup + Requirements]
Follow branch-setup.md for branch/connection selection
|
[requirements brief in context?] ── NO ─> invoke `requirements-gathering`
|
[Phase 2: Embed vs Form decision]
Consult references/embeds.md → "Purpose & When to Use":
- render a URL or an HTML blob, no controls needed -> embed
- needs field inputs, a toolbar, or a Print button
that lives outside the rendered content -> form (or put the
control inside the HTML)
If field controls/toolbar are required -> invoke `form-creator` and stop here.
|
[Phase 3: Pick the source — URL or HTML string]
URL -> iframeConfig.href points at the URL (directly or via a var
computed in on_init). Example: a hosted map.
HTML string -> on_init sets a var to a data:text/html URI built from the
HTML; iframeConfig.href points at that var.
|
[Phase 4: Author embed body]
Build body.json from references/embeds.md → Minimal Valid Skeleton:
- type: "iframe" (the only supported designer type)
- iframeConfig.href (REQUIRED — a TS expression, usually $embed.vars.<url>)
- inParams[] (the URL / HTML / id the host passes in)
- vars[] (the computed href var)
- onInitFlowConfig -> on_init flow that computes the href var
|
[Phase 5: Validate + push]
dxs configuration validate embed -b <branchId> -D body.json
dxs configuration upsert embed -b <branchId> -D body.json
|
[Phase 6: Wire the opener + verify]
Caller opens it: $shell.open<referenceName>Dialog(inParamsObj, 'flyout', EModalSize.Xlarge) (+ <Package>. segment if the embed is in a module)
Verify in Studio: iframe renders; if HTML preview, the in-document Print button works
|
[invoke `post-edit-verification`; then `component-validator`][Phase 1: Setup + Requirements]
Follow branch-setup.md for branch/connection selection
|
[requirements brief in context?] ── NO ─> invoke `requirements-gathering`
|
[Phase 2: Embed vs Form decision]
Consult references/embeds.md → "Purpose & When to Use":
- render a URL or an HTML blob, no controls needed -> embed
- needs field inputs, a toolbar, or a Print button
that lives outside the rendered content -> form (or put the
control inside the HTML)
If field controls/toolbar are required -> invoke `form-creator` and stop here.
|
[Phase 3: Pick the source — URL or HTML string]
URL -> iframeConfig.href points at the URL (directly or via a var
computed in on_init). Example: a hosted map.
HTML string -> on_init sets a var to a data:text/html URI built from the
HTML; iframeConfig.href points at that var.
|
[Phase 4: Author embed body]
Build body.json from references/embeds.md → Minimal Valid Skeleton:
- type: "iframe" (the only supported designer type)
- iframeConfig.href (REQUIRED — a TS expression, usually $embed.vars.<url>)
- inParams[] (the URL / HTML / id the host passes in)
- vars[] (the computed href var)
- onInitFlowConfig -> on_init flow that computes the href var
|
[Phase 5: Validate + push]
dxs configuration validate embed -b <branchId> -D body.json
dxs configuration upsert embed -b <branchId> -D body.json
|
[Phase 6: Wire the opener + verify]
Caller opens it: $shell.open<referenceName>Dialog(inParamsObj, 'flyout', EModalSize.Xlarge) (+ <Package>. segment if the embed is in a module)
Verify in Studio: iframe renders; if HTML preview, the in-document Print button works
|
[invoke `post-edit-verification`; then `component-validator`]iframeConfig.hrefsrcdoctypeiframepowerBion_init$embed.inParamsdata:on_init$embed.vars.ref_url = "data:text/html;charset=utf-8," + encodeURIComponent($embed.inParams.html);iframeConfig.href"$embed.vars.ref_url"iframeConfig.hrefsrcdoctypeiframepowerBion_init$embed.inParamson_initdata:$embed.vars.ref_url = "data:text/html;charset=utf-8," + encodeURIComponent($embed.inParams.html);iframeConfig.href"$embed.vars.ref_url"body.jsonconfigurationTypeId: 20-embed.jsonreferenceName_embeddescriptiontype: "iframe"EEmbedDesignerTypepowerBihtmlscriptcontentcodeiframeConfig.href$embed.vars.ref_url"'https://example.com'"on_initinParams$embed.vars.<id>vars[]on_initonInitFlowConfigconfigurationTypeId: 9$embed.inParamsdata:body.jsonconfigurationTypeId: 20-embed.jsonreferenceName_embeddescriptiontype: "iframe"EEmbedDesignerTypepowerBihtmlscriptcontentcodeiframeConfig.href$embed.vars.ref_url"'https://example.com'"on_initinParams$embed.vars.<id>vars[]on_initonInitFlowConfigconfigurationTypeId: 9$embed.inParamsdata:// top-level embed (no package):
await $shell.opencustom_email_preview_embedDialog({ html: previewHtml }, 'flyout', EModalSize.Xlarge);
// embed registered under a package:
await $shell.<Package>.opencustom_email_preview_embedDialog({ html: previewHtml }, 'flyout', EModalSize.Xlarge);openreferenceNameDialog$shell.open<referenceName>Dialog(...)<Package>inParamsconfigParametersmoduleIdcomponent-wiring-check// 顶层embed(无包):
await $shell.opencustom_email_preview_embedDialog({ html: previewHtml }, 'flyout', EModalSize.Xlarge);
// 在包下注册的embed:
await $shell.<Package>.opencustom_email_preview_embedDialog({ html: previewHtml }, 'flyout', EModalSize.Xlarge);openreferenceNameDialog$shell.open<referenceName>Dialog(...)<Package>inParamsconfigParametersmoduleIdcomponent-wiring-checkconfigurationTypeId: 20-embed.jsonreferenceName_embedtitletype: "iframe"powerBiiframeConfig.hrefHREF is requiredvars[]on_initdata:text/html;charset=utf-8,encodeURIComponent(...)srcdoconclick="window.print()"@media printconfigParametersinParamcomponent-wiring-checkdescriptionconfigurationTypeId: 20-embed.jsonreferenceName_embedtitletype: "iframe"powerBiiframeConfig.hrefvars[]on_initdata:text/html;charset=utf-8,encodeURIComponent(...)srcdoconclick="window.print()"@media printinParamconfigParameterscomponent-wiring-checkdescriptionsrcdociframetypehtmlscriptcontentdata:text/htmlhrefiframeConfig.hrefHREF is required$embed.vars.<id>vars[]hrefhref"'https://...'"on_init.jsonjq .json envelope.json > body.jsonpost-edit-verificationcomponent-validatorsrcdociframehtmlscriptcontenthrefdata:text/htmliframeConfig.href$embed.vars.<id>vars[]hrefhref"'https://...'"on_init.jsonjq .json envelope.json > body.jsonpost-edit-verificationcomponent-validator