@malloydata/render 0.0.210-dev241111185044 → 0.0.210-dev241111203713

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.
@@ -139,7 +139,7 @@ export function viteMalloyStoriesPlugin(): PluginOption {
139
139
  };`
140
140
  : `
141
141
  import script from '${id}?raw';
142
- import {createLoader} from './util';
142
+ import {createLoader, copyMalloyRenderHTML} from './util';
143
143
  import './themes.css';
144
144
  import '../component/render-webcomponent';
145
145
 
@@ -152,6 +152,12 @@ export function viteMalloyStoriesPlugin(): PluginOption {
152
152
  const el = document.createElement('malloy-render');
153
153
  if (classes) el.classList.add(classes);
154
154
  el.result = context.loaded['result'];
155
+
156
+ const button = document.createElement('button');
157
+ button.innerHTML = "Copy HTML";
158
+ button.addEventListener("click", () => copyMalloyRenderHTML(el));
159
+
160
+ parent.appendChild(button);
155
161
  parent.appendChild(el);
156
162
  return parent;
157
163
  },
@@ -17,4 +17,5 @@ type RenderOptions = QueryOptions & {
17
17
  classes?: '';
18
18
  };
19
19
  export declare function renderMalloyLegacy(options: RenderOptions): HTMLDivElement;
20
+ export declare function copyMalloyRenderHTML(element: Element): Promise<void>;
20
21
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/render",
3
- "version": "0.0.210-dev241111185044",
3
+ "version": "0.0.210-dev241111203713",
4
4
  "license": "MIT",
5
5
  "main": "dist/module/index.umd.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "build-types": "tsc --build --declaration --emitDeclarationOnly"
31
31
  },
32
32
  "dependencies": {
33
- "@malloydata/malloy": "^0.0.210-dev241111185044",
33
+ "@malloydata/malloy": "^0.0.210-dev241111203713",
34
34
  "@tanstack/solid-virtual": "^3.10.4",
35
35
  "component-register": "^0.8.6",
36
36
  "lodash": "^4.17.20",