Logo Sap Sac Custom Widget

Sap Sac Custom Widget

Cộng đồng
secondsky
sap-sac-custom-widget

SAP Analytics Cloud (SAC) Custom Widget development. Use when building custom visualizations, extending SAC with Web Components, or creating Widget Add-Ons. Covers JSON metadata, JavaScript Web Components, lifecycle functions, data binding with feeds, styling/builder panels, property/event/method definitions, third-party library integration, hosting, security, performance, and debugging. Includes Widget Add-On feature (QRC Q4 2023+) and templates for widgets, charts, and KPI cards.

Add to TypingMind

Tổng quan

Nhà phát hànhsecondsky
Kho mãsap-skills
Tên kỹ năngsap-sac-custom-widget
Sao
445
Bản fork
117
Tệp đi kèm
34
Giấy phépGPL-3.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 34 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được secondsky công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Sap Sac Custom Widget trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/secondsky/sap-skills/tree/main/plugins/sap-sac-custom-widget/skills/sap-sac-custom-widget
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/secondsky/sap-skills.git /tmp/sap-skills
mkdir -p .claude/skills
cp -r /tmp/sap-skills/plugins/sap-sac-custom-widget/skills/sap-sac-custom-widget .claude/skills/sap-sac-custom-widget
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Sap Sac Custom Widget trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Sap Sac Custom Widget ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Sap Sac Custom Widget với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

SAP Analytics Cloud Custom Widget Development

Related Skills

  • sap-sac-scripting: Use when custom widgets interact with SAC scripting, widgets, or story/application APIs
  • sap-sac-planning: Use when widgets participate in planning workflows or planning table interactions
  • sapui5: Use for Web Component/UI5 frontend implementation patterns and browser-side quality
  • sap-dependency-security: Use when adding third-party charting or build dependencies to widget projects

Table of Contents

Overview

This skill enables development of custom widgets for SAP Analytics Cloud (SAC). Custom widgets are Web Components that extend SAC stories and applications with custom visualizations, interactive elements, and specialized functionality.

When to Use This Skill

Use this skill when:

  • Building custom visualizations not available in standard SAC
  • Generating prompt-driven widget ideas, branded widget packages, or composite-ready widget designs
  • Integrating third-party charting libraries (ECharts, D3.js, Chart.js)
  • Creating interactive input components for SAC applications
  • Implementing specialized data displays or KPI widgets
  • Extending Analytics Designer applications with custom functionality
  • Troubleshooting custom widget loading or data binding issues

Requirements:

  • SAC tenant with Optimized Story Experience or Analytics Designer
  • JavaScript/Web Components knowledge
  • External hosting (GitHub Pages, AWS S3, Azure) OR SAC-hosted resources (QRC Q2 2023+)

AI-Assisted Generation

For prompt-driven widget creation, first classify the widget role and data-source mode, then suggest 2-3 role-aware options before generating the selected complete package. Keep AI-generated code SAC-compatible, preserve data-binding order when used, and validate/repair before import. See references/ai-assisted-composite-generation.md for output contracts, RAG context patterns, brand styling, and composite caveats.


Widget Discovery and Evidence Intake

Before generating a table, chart, KPI, menu, sidebar, filter, or hybrid control, select both its widget role and data-source mode. Request dimensions, measures/key figures, dates, versions, filters, and feed order only for SAC-bound widgets. For pure UI controls, collect interaction, navigation, state, method/event, accessibility, and responsive-layout requirements instead. Accept user-provided screenshots, PDFs, images, brand guides, and sanitized data as evidence, but confirm technical IDs, feed mappings, asset rights, and licenses before code generation. See references/widget-discovery-intake.md for the Widget Brief, evidence boundaries, and hosted-tool safeguards.


Local Custom Widget Builder

For enterprise or locked-down local environments, offer templates/local-builder/ as the standard no-install scaffold builder. It runs as static HTML/CSS/vanilla JavaScript, avoids public CDNs and external packages, and exports SAC upload artifacts as two separate downloads: widget.json and a Resource-ZIP containing only root-level component JavaScript files. Use Node's server.mjs fallback when direct file:// use is blocked. When a user explicitly permits public-web use for a non-sensitive desktop prototype, optionally suggest the Custom Widget Builder or live demo; never send tenant material or trust its exports without local validation. See references/local-builder-workflow.md for builder boundaries, export rules, hosted-tool safeguards, and validation checks.


SAP Sample Widget Lessons

Before generating a chart, KPI, hierarchy, input utility, Widget Add-On, or build-based widget, consult references/sap-sample-widget-lessons.md. It audits every SAP sample folder and distills reusable lessons for Data Binding-first scaffolds, root-relative Resource-ZIP URLs, styling/builder panel separation, support flags, custom types, script methods/events, add-on extensions[], and build-based app caveats. Use the lessons for structure and risk checks only; do not copy SAP sample code or assets into generated packages.


Browser Design Runtime

Generated widget packages should include templates/design-runtime/ as a no-build, file-first browser preview scaffold. Use it after generation to mock custom-widget essentials outside SAP, adjust properties/design tokens/sample data/viewports, compare multiple widgets, and export an agent iteration payload. See references/browser-design-runtime.md for runtime boundaries and configuration/export contracts. Use templates/local-builder/ for scaffold generation/export; use templates/design-runtime/ for preview and iteration.


CSS and Styling Compliance

Style custom widgets inside their Web Component/Shadow DOM boundary. Do not rely on SAC optimized story theme CSS, SAP shell selectors, or global story CSS to style widget internals. For generated packages, confirm the hosting mode before splitting CSS/HTML into separate files, because SAC ZIP upload packages support component JavaScript and PNG/JPG icons only. See references/css-and-styling-compliance.md for SAP Help-backed allowed/restricted styling rules.


SAC Import and Packaging

Decide the delivery mode before generating widget.json: SAC Resource-ZIP upload and external HTTPS hosting use different URL rules. For SAC Resource-ZIP upload, deliver widget.json separately, upload it first, and only then upload a Resource-ZIP containing root-level component JavaScript files such as widget.js, builder.js, and styling.js. Do not include widget.json, subfolders, tests, README files, CSS, or HTML in that Resource-ZIP.

For Resource-ZIP manifests, use root-relative component URLs such as "/widget.js"; for external hosting, use complete HTTPS URLs. Keep local-preview paths like "widget.js" in preview-only configs unless the target SAC flow explicitly documents that resolution mode. Model simple configurable colors as string properties with hex defaults such as "#f4f7fa"; use the Color type only after the exact SAC tenant and target panel flow accepts it. Browser preview and Node tests are useful, but they are not proof of SAC importability. For widgets with builder/styling panels, preserve focus and collapse state during text edits, keep component JS self-contained, and validate final outputs/ artifacts rather than source-only previews. When the widget is done, the final chat response must offer both completed upload artifacts for download: the widget.json manifest and the Resource-ZIP. See references/sac-import-packaging-lessons.md for upload sequence, ZIP content checks, final-artifact tests, builder/tree rules, final download handoff, and SAC error triage.


Production Audit Lessons

When a widget is rejected by SAC despite passing local tests, consult references/production-widget-lessons.md. It covers raw control characters in bundles, Analytics Designer method-body limits, required integrity states, client-side-only manifest validation, icon and font isolation, user and language boundaries, bookmark risk, opaque-error bisection, behavioral preflight guards, and browser-preview limits. Treat its evidence labels as part of the guidance: tenant observations, SAP-documented behavior, and unconfirmed hypotheses must not be presented as equivalent.

Property Lifecycle

Treat SAC properties as an external state stream. SAC may deliver properties one at a time, echo values written by the widget, and change their representation. Merge updates, normalize through one read path, and render from the merged state. Do not assume property order or consume builder initialization flags on an empty first render. Manifest method bodies are Analytics Designer script: they may read or write declared properties, but they cannot call private component methods.

Builder and styling panels are stateful editors. Keep text edits targeted so focus, caret, selection, search, and collapse state survive. Preserve unknown configuration keys when two editors share a document, and keep one user action to one property dispatch and one undo step. For structured import or export, preserve stable ids, deep-copy nested templates, use null-prototype maps for user-authored names, and test every language slot. See references/property-lifecycle.md.

Verification and Artifact Discipline

Validate the built component files and final Resource-ZIP, not only source helpers or a browser preview. Generate all outputs first, validate them, then write them. Test the final bundles standalone, verify exact SRI bytes, scan for raw control characters, and use a real browser for layout, focus, font, pointer, and lifecycle behavior that DOM emulation cannot represent. See references/verification-and-artifacts.md.


Plugin Components

This plugin provides specialized agents, commands, and validation hooks for comprehensive widget development support.

Agents

AgentColorPurposeTrigger Examples
widget-architectBlueDesign widget structure, metadata, and integration patterns"design custom widget", "plan widget architecture"
widget-debuggerYellowTroubleshoot loading, data binding, CORS, and runtime issues"widget won't load", "CORS error", "data not binding"
widget-api-assistantGreenWrite JavaScript widget code, lifecycle functions, API integrations"write widget code", "implement lifecycle functions"

Commands

CommandUsageDescription
/widget-validate/widget-validate [file]Validate widget.json schema and widget.js structure
/widget-generate/widget-generateInteractively generate widget scaffold with JSON, JS, local builder, and browser design runtime
/widget-lint/widget-lint [file]Performance, security, and best practices analysis

Validation Hooks

Automatic quality checks triggered on Write/Edit operations:

  • widget.json: Required fields, tag naming, property types, data binding config
  • widget.js: Lifecycle functions, Shadow DOM, propertiesChanged dispatch
  • Performance: Resize debouncing, chart disposal, XSS prevention
  • Context Reminders: Template suggestions, command recommendations

Templates

Ready-to-use scaffolds in templates/ directory:

  • basic-widget.js - Minimal Web Component with all lifecycle functions
  • data-bound-chart.js - ECharts widget with data binding
  • styling-panel.js - Runtime customization panel
  • builder-panel.js - Design-time configuration panel
  • local-builder/ - Static local scaffold builder and SAC artifact exporter
  • design-runtime/ - Browser preview and design iteration runtime
  • widget.json-minimal - Bare-minimum metadata
  • widget.json-complete - Full-featured metadata with all options

Quick Start

Minimal Custom Widget Structure

A custom widget requires two files:

1. widget.json (Metadata)

json
{
  "id": "com.company.mywidget",
  "version": "1.0.0",
  "name": "My Custom Widget",
  "description": "A simple custom widget",
  "vendor": "Company Name",
  "license": "MIT",
  "icon": "",
  "webcomponents": [
    {
      "kind": "main",
      "tag": "my-custom-widget",
      "url": "https://your-host.com/widget.js",
      "integrity": "",
      "ignoreIntegrity": true
    }
  ],
  "properties": {
    "title": {
      "type": "string",
      "default": "My Widget"
    }
  },
  "methods": {},
  "events": {}
}

2. widget.js (Web Component)

javascript
(function() {
  const template = document.createElement("template");
  template.innerHTML = `
    <style>
      :host {
        display: block;
        width: 100%;
        height: 100%;
      }
      .container {
        padding: 16px;
        font-family: Arial, sans-serif;
      }
    </style>
    <div class="container">
      <h3 id="title">My Widget</h3>
      <div id="content"></div>
    </div>
  `;

  class MyCustomWidget extends HTMLElement {
    constructor() {
      super();
      this._shadowRoot = this.attachShadow({ mode: "open" });
      this._shadowRoot.appendChild(template.content.cloneNode(true));
      this._props = {};
    }

    connectedCallback() {
      // Called when element is added to DOM
    }

    onCustomWidgetBeforeUpdate(changedProperties) {
      // Called BEFORE properties are updated
      this._props = { ...this._props, ...changedProperties };
    }

    onCustomWidgetAfterUpdate(changedProperties) {
      // Called AFTER properties are updated - render here
      if (changedProperties.title !== undefined) {
        this._shadowRoot.getElementById("title").textContent = changedProperties.title;
      }
    }

    onCustomWidgetResize() {
      // Called when widget is resized
    }

    onCustomWidgetDestroy() {
      // Cleanup when widget is removed
    }

    // Property getter/setter (required for SAC framework)
    get title() {
      return this._props.title;
    }
    set title(value) {
      this._props.title = value;
      this.dispatchEvent(new CustomEvent("propertiesChanged", {
        detail: { properties: { title: value } }
      }));
    }
  }

  customElements.define("my-custom-widget", MyCustomWidget);
})();

⚠️ Production Note: The ignoreIntegrity: true setting above is development only. For production deployments, generate a SHA256 integrity hash and set ignoreIntegrity: false.


Community Sample Widgets

SAP provides a community sample repository with 17 custom widget sample folders:

Repository: SAP-samples/SAC_Custom_Widgets

CategoryWidgets
ChartsFunnel, Pareto, Sankey, Sunburst, Tree, Line, UI5 Gantt
KPI/GaugeKPI Ring, Gauge Grade, Half Donut, Nested Pie, Custom Pie
UtilitiesFile Upload, Word Cloud, Bar Gradient, Widget Add-on Sample

Requirements: Most samples assume Data Binding and Optimized View Mode (OVM) or Optimized and Unified Story Experience.

Note: Check third-party library licenses before production use, adjust hosted component paths when moving samples, and treat live SAC import/runtime validation as tenant-specific. See references/sap-sample-widget-lessons.md for the per-sample audit and creation lessons.


Key Concepts

Lifecycle Functions

Essential functions called by SAC framework:

  • onCustomWidgetBeforeUpdate(changedProperties) - Pre-update hook
  • onCustomWidgetAfterUpdate(changedProperties) - Post-update (render here)
  • onCustomWidgetResize() - Handle resize events
  • onCustomWidgetDestroy() - Cleanup resources

Data Binding

Configure in widget.json to receive SAC model data:

json
{
  "dataBindings": {
    "myDataBinding": {
      "feeds": [
        {
          "id": "dimensions",
          "description": "Dimensions",
          "type": "dimension"
        },
        {
          "id": "measures",
          "description": "Measures",
          "type": "mainStructureMember"
        }
      ]
    }
  }
}

Access data in JavaScript:

javascript
// Get data binding
const dataBinding = this.dataBindings.getDataBinding("myDataBinding");

// Access result set
const data = this.myDataBinding.data;
const metadata = this.myDataBinding.metadata;

// Iterate over rows
for (let i = 0; i < this.myDataBinding.data.length; i++) {
  const row = this.myDataBinding.data[i];
  const dimensionValue = row.dimensions_0 ? row.dimensions_0.label : "";
  const measureValue = row.measures_0 ? row.measures_0.raw : 0;
}

Hosting Options

1. SAC-Hosted (Recommended, QRC Q2 2023+)

  • Upload files directly to SAC > Files > Public Files
  • For Resource-ZIP upload flows, upload widget.json first, then upload a separate Resource-ZIP when SAC enables the Resource File button
  • For Resource-ZIP upload flows, use root-relative URLs such as "/widget.js"; do not use local Windows backslashes or bare local preview paths in the production manifest
  • Set "integrity": "" and "ignoreIntegrity": true

2. GitHub Pages

  • Create repository with widget files
  • Enable GitHub Pages in Settings
  • Use URL: https://username.github.io/repo/widget.js

3. External Web Server

  • AWS S3, Azure Blob, or any HTTPS server
  • Must include CORS headers: Access-Control-Allow-Origin: *

Security: Integrity Hash

For production, generate a SHA256 integrity value with Node.js for Windows/macOS/Linux:

bash
# Generate integrity hash for widget.js
node -e "const fs=require('node:fs');const crypto=require('node:crypto');const file=process.argv[1]||'widget.js';console.log('sha256-'+crypto.createHash('sha256').update(fs.readFileSync(file)).digest('base64'));" widget.js

# Update JSON
"integrity": "sha256-abc123...",
"ignoreIntegrity": false

On macOS/Linux or Git Bash, OpenSSL is also acceptable; prefix the output with sha256- before adding it to the manifest:

bash
openssl dgst -sha256 -binary widget.js | openssl base64 -A

Common Errors & Solutions

ErrorCauseSolution
"The system couldn't load the custom widget"Incorrect URL or hosting issueVerify URL is accessible, check CORS
"Integrity check failed"Hash mismatchRegenerate hash after JS changes
Widget not appearingMissing connectedCallback renderCall render in onCustomWidgetAfterUpdate
Properties not updatingMissing propertiesChanged dispatchUse dispatchEvent with propertiesChanged
Data not displayingData binding misconfiguredVerify feeds in JSON match usage
CUSTOM_WIDGET_SERVICE_EXCEPTION or opaque HTTP 500Raw control or ambiguous code point, malformed method body, manifest/ZIP pair, or another upload constraintScan source and bundles for control code points, BOM, zero-width characters, and line separators, then use one-variable JSON and ZIP probes
Method body rejected with unknown function or type errorsBody calls component internals instead of using declared propertiesDeclare the state as a property and have the body read or write that property
Manifest rejected for missing integritywebcomponents[] omitted the required fieldAdd integrity and use either development "" plus ignoreIntegrity: true or a real sha256-... digest plus false
Icons render blankIcon name is not bundled or was guessedGenerate and search a committed icon map; do not depend on IconPool inside the widget
Widget has the wrong fontForm controls use their UA font or panel CSS overrides SACInherit the font on controls and avoid custom font stacks in design-time panels
Personal or language value is empty or wrongWidget tried to discover user or SAC locale contextPass it through a declared property from story script
"Color" is not a valid type or default expected as ColorTenant/import flow rejected simple color propertiesUse string plus hex defaults for simple configurable colors
Main component could not be loadedResource URL, ZIP content, or JS syntax problemCheck root-relative webcomponents[].url, Resource-ZIP root contents, then node --check
Resource File upload is disabledwidget.json has not validated yetUpload and validate widget.json first, then upload the Resource-ZIP
Resource-ZIP imports/later load failsZIP contains manifest, folders, CSS/HTML, or unrelated filesKeep only root-level JS component files and optional PNG/JPG icons
Builder input loses focus or collapse stateText edits trigger full renderUpdate field/row/JSON text directly; reserve full render for structural changes
Preview works but SAC component fails standalonePreview depends on a shared source helper not present in bundled JSTest final widget.js, builder.js, and styling.js without preview-only helper scripts
Duplicate menu items collideSubtree duplicate rewrote only root IDRewrite descendant IDs and test uniqueness across the whole tree
Panel shows a value that runtime ignoresProperty is stored or exported but never read by the runtimeAdd a runtime-use check and a behavior test for every manifest property
Valid zero becomes a defaultNumeric coercion uses `Number(value)
Builder loses typed text or search stateEvery update rebuilds the panelPatch fields in place and restore focus, selection, and caret when structural rendering is required
Rename or duplicate leaves stale stateIdentity is positional or a shallow copy aliases nested dataPreserve stable ids, deep-copy templates, and enumerate every reference holder
Layout passes DOM tests but fails in SACTest environment has no layout or font metricsVerify geometry and font-dependent behavior in a real browser
A user-authored name behaves inconsistently by caseMembership checks use exact comparisons in multiple sitesCentralize the matching rule and test a case-only rename

Debugging

Browser DevTools

  1. Open Chrome DevTools (F12)
  2. Sources tab: Find widget.js, set breakpoints
  3. Console tab: View console.log output
  4. Network tab: Check if files load (200 status)

Debug Pattern

javascript
onCustomWidgetAfterUpdate(changedProperties) {
  console.log("Widget updated:", changedProperties);
  console.log("Current props:", this._props);
  console.log("Data binding:", this.myDataBinding && this.myDataBinding.data);
  this._render();
}

Widget Add-Ons (QRC Q4 2023+)

Widget Add-Ons extend built-in SAC widgets without building from scratch.

Use Cases:

  • Customize chart tooltips
  • Add visual elements to plot areas
  • Override built-in styling

Supported Charts: Bar/Column, Stacked Bar/Column, Line, Stacked Area, Numeric Point

Key Differences:

  • Only main and builder components (no styling)
  • Must specify extension target (tooltip, plotArea, numericPoint)
  • SAC provides chart context data via methods

See references/widget-addon-guide.md for complete implementation.


Bundled Resources

Templates (Ready-to-Use Code)

  • templates/basic-widget.js - Minimal Web Component scaffold (~60 lines)
  • templates/data-bound-chart.js - ECharts widget with SAC data binding (~120 lines)
  • templates/styling-panel.js - Styling panel for runtime customization (~150 lines)
  • templates/builder-panel.js - Builder panel for design-time configuration
  • templates/local-builder/ - No-install local builder for metadata, feeds, properties, methods, events, and SAC two-file export
  • templates/design-runtime/ - No-build browser preview, design-token controls, scenario switching, and agent iteration export
  • templates/widget.json-minimal - Bare-minimum metadata (~25 lines)
  • templates/widget.json-complete - Full-featured metadata (~100 lines)

Reference Documentation

  1. references/json-schema-reference.md - Complete JSON schema documentation
  2. references/widget-templates.md - Additional widget template patterns (6 templates)
  3. references/echarts-integration.md - ECharts library integration guide
  4. references/widget-addon-guide.md - Widget Add-On development (QRC Q4 2023+)
  5. references/best-practices-guide.md - Performance, security, and development guidelines
  6. references/advanced-topics.md - Custom types, script API types, installation
  7. references/integration-and-migration.md - Script integration, content transport
  8. references/script-api-reference.md - DataSource, Selection, MemberInfo APIs
  9. references/ai-assisted-composite-generation.md - Prompt-driven generation, RAG, brand styling, validation, and composite-ready output guidance
  10. references/local-builder-workflow.md - Enterprise-safe local builder workflow, export contract, and validation checklist
  11. references/sap-sample-widget-lessons.md - SAP sample widget audit matrix, reusable generation lessons, and add-on/build-based routing caveats
  12. references/browser-design-runtime.md - Non-SAP browser preview runtime, sidecar config, and agent iteration export
  13. references/css-and-styling-compliance.md - SAP Help-backed CSS, theme, Shadow DOM, and packaging guidance for generated widgets
  14. references/sac-import-packaging-lessons.md - SAC-hosted Resource-ZIP upload sequence, URL rules, ZIP hygiene, builder/tree state rules, self-contained component checks, final-artifact tests, and SAC error triage
  15. references/widget-discovery-intake.md - Widget role/data-source selection, attachment intake, Widget Brief, and hosted-tool safeguards
  16. references/production-widget-lessons.md - Tenant-observed upload failures, script method limits, integrity, isolation, bisection, and preflight guards
  17. references/property-lifecycle.md - SAC property normalization, script method boundaries, stateful editors, persistence, and structured data rules
  18. references/verification-and-artifacts.md - Built-bundle verification, test blind spots, mutation evidence, upload triage, and deterministic artifact checks

Official Documentation Links

Primary References (for skill updates):

Sample Widgets:


Version History

Unreleased

  • Added property lifecycle and artifact verification guidance from the consolidated custom-widget lessons, including canonical coercion, stateful panel editing, runtime-use checks, real-browser boundaries, and deterministic final-package checks
  • Clarified hosting-mode URL validation, dangerous Unicode/control-code-point scanning, declared-locale handling, and missing-tool verification outcomes
  • Added production audit lessons for control-character upload failures, property-only Analytics Designer method bodies, required integrity states, opaque-error bisection, isolated icons/fonts, bookmark risks, and behavioral preflight checks
  • Corrected JSON method guidance so manifest method bodies do not call web component internals
  • Added an enterprise-safe templates/local-builder/ scaffold for local widget metadata, property/feed configuration, and SAC two-file artifact export
  • Added templates/builder-panel.js so builder panel generation has a bundled self-contained template
  • Added local builder validation coverage without advancing last_verified; live SAC upload/runtime validation remains pending
  • Added SAP sample-widget lessons and local-builder pattern hints for data-bound charts, KPI/gauge widgets, flow/hierarchy widgets, input utilities, Widget Add-ons, and build-based apps without copying upstream sample code

v2.3.2 (2026-07-06)

  • Added SAC Resource-ZIP import lessons from the Configurable Menu Navigation project
  • Clarified separate widget.json and Resource-ZIP upload flow, root-relative SAC-hosted URLs, Resource-ZIP content hygiene, and simple color property portability
  • Added hook warnings for bare Resource-ZIP component URLs and risky Color property usage
  • Expanded Configurable Menu Navigation lessons for builder focus/collapse state, tree duplicate ID rewrites, self-contained component JS, preview parity, stale panel cleanup, layout/styling property sync, safe output cleanup, and artifact naming
  • Required final chat handoff to offer both the widget.json manifest and Resource-ZIP as separate downloadable artifacts

v2.1.0 (2026-06-12)

  • Refreshed to SAC Q2 2026 (version 2026.8)
  • No custom-widget framework changes in QRC1/QRC2 2026; lifecycle functions and JSON schema unchanged
  • Documented previously missing root-level properties: eula, imports, supportsMobile, supportsExport, supportsLinkedAnalysisFilterOnSelection, supportsViewportLoading, supportsBookmark, types
  • Documented webcomponent type property for ES module loading
  • Documented includeInBookmarks per-property flag, boolean[]/integer[] types
  • Added serializeCustomWidgetToImage() and customWidgetRenderComplete to advanced topics
  • Confirmed: all four lifecycle functions unchanged, feed types unchanged, templates valid

v2.0.0 (2025-12-27)

  • Added 3 specialized agents: widget-architect, widget-debugger, widget-api-assistant
  • Added 3 slash commands: /widget-validate, /widget-generate, /widget-lint
  • Added validation hooks for automatic quality checks on Write/Edit
  • Added 5 docs-audited templates in templates/ directory
  • Enhanced plugin structure to match comprehensive plugin pattern
  • Updated last verified date

v1.2.0 (2025-11-26)

  • Updated SAC version reference to 2025.21
  • Optimized SKILL.md length from 563 to ~200 lines
  • Added Table of Contents to all 8 reference files
  • Improved progressive disclosure architecture

v1.1.0 (2025-11-22)

  • Added Widget Add-On feature documentation (QRC Q4 2023+)
  • Added best practices guide (performance, security, development)
  • Added advanced topics (custom types, script API types, installation)
  • Enhanced description with additional keywords
  • Increased error prevention coverage to 25+

v1.0.0 (2025-11-22)

  • Initial release
  • Complete JSON metadata reference
  • Lifecycle functions documentation
  • Data binding guide
  • Styling panel implementation
  • Hosting options (SAC-hosted, GitHub, external)
  • Security (integrity hash, CORS)
  • Common errors and debugging

SAC Version: 2026.8

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Sap Sac Custom Widget làm được gì?

SAP Analytics Cloud (SAC) Custom Widget development. Use when building custom visualizations, extending SAC with Web Components, or creating Widget Add-Ons. Covers JSON metadata, JavaScript Web Components, lifecycle functions, data binding with feeds, styling/builder panels, property/event/method definitions, third-party library integration, hosting, security, performance, and debugging. Includes Widget Add-On feature (QRC Q4 2023+) and templates for widgets, charts, and KPI cards.

Vì sao nên dùng Sap Sac Custom Widget trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Sap Sac Custom Widget là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Sap Sac Custom Widget trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/secondsky/sap-skills/tree/main/plugins/sap-sac-custom-widget/skills/sap-sac-custom-widget. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Sap Sac Custom Widget?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Sap Sac Custom Widget với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Sap Sac Custom Widget với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Sap Sac Custom Widget có miễn phí không?

Có. Kỹ năng này được secondsky phát hành trên GitHub theo giấy phép GPL-3.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇