bb_component_supertextbox 1.0.1

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.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # SuperTextbox
2
+
3
+ Super Textbox
4
+
5
+ A rich text display component for rendering formatted content with support for markdown, HTML, and variable bindings.
6
+
7
+ ## Metadata
8
+
9
+ | | |
10
+ |---|---|
11
+ | **Type** | Budibase Component |
12
+ | **Category** | basic |
13
+ | **Topics** | `budibase`, `component`, `basic` |
14
+
15
+ ## Development
16
+
17
+ ```bash
18
+ bun install
19
+ bun link @poirazis/superlib
20
+ bun run build
21
+ ```
22
+
23
+ ## Schema
24
+
25
+ See `schema.json` for the component definition.
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "bb_component_supertextbox",
3
+ "version": "1.0.1",
4
+ "description": "Super Textbox",
5
+ "license": "MIT",
6
+ "author": "Michael Poirazi - https://github.com/poirazis"
7
+ }
@@ -0,0 +1,2 @@
1
+ !function(){try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".textbox.value.svelte-826hul{background-color:#0000;flex:1 0 100%;align-items:center;gap:.5rem;min-width:0;display:flex;overflow:hidden}.textbox.value.svelte-826hul:focus{outline:none}.textbox-icon.svelte-826hul{color:var(--spectrum-global-color-gray-600);margin-left:-.25rem}.textbox.value.monospace.svelte-826hul{font-family:var(--spectrum-global-font-family-monospace)}.textbox.value.copyable.svelte-826hul{justify-content:space-between;min-width:0}.copy-icon.svelte-826hul{font-size:15px;transition:color .15s}.copy-icon.copied.svelte-826hul{color:var(--spectrum-global-color-green-700)!important}.textbox.value.copyable.svelte-826hul .copy-icon:where(.svelte-826hul){opacity:.45;color:var(--spectrum-global-color-gray-600);flex-shrink:0;align-items:center;margin-left:.5rem;transition:opacity .15s;display:flex}.textbox.value.copyable.icon-on-hover.svelte-826hul .copy-icon:where(.svelte-826hul){opacity:0}.textbox.value.copyable.svelte-826hul:hover:not(.disabled) .copy-icon:where(.svelte-826hul),.textbox.value.copyable.svelte-826hul:focus:not(.disabled) .copy-icon:where(.svelte-826hul){opacity:.85}.textbox.value.copyable.svelte-826hul:hover:not(.disabled) .copy-icon:where(.svelte-826hul):hover{opacity:1}.textbox-text.svelte-826hul{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.textbox-text.wrap.svelte-826hul{white-space:normal;text-overflow:unset;word-break:break-word;overflow:visible}.textbox-wrapper.svelte-1l9u2si{overflow:hidden}.plugin-error.svelte-1q1ah0h{border:1px solid var(--spectrum-global-color-red-400);background:var(--spectrum-global-color-red-100);color:var(--spectrum-global-color-red-800);box-sizing:border-box;border-radius:4px;flex-direction:column;gap:.25rem;width:100%;padding:.5rem .75rem;font-size:13px;display:flex}.plugin-error-title.svelte-1q1ah0h{font-weight:600}.plugin-error-detail.svelte-1q1ah0h{color:var(--spectrum-global-color-red-700);word-break:break-word;font-size:12px}\n/*$vite$:1*/")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}}();
2
+ var plugin=function(e,t,o){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var a,p,r,l=Object.create,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,c=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;r=null!=(a=t)?l(c(a)):{};var u=(t=((e,t,o,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var p,r=i(t),l=0,c=r.length;l<c;l++)p=r[l],d.call(e,p)||p===o||n(e,p,{get:(e=>t[e]).bind(null,p),enumerable:!(a=s(t,p))||a.enumerable});return e})(!p&&a&&a.__esModule?r:n(r,"default",{value:a,enumerable:!0}),a)).from_html('<i aria-hidden="true"></i>'),b=t.from_html('<i aria-hidden="true"></i>'),y=t.from_html('<span role="button"><!> <span> </span> <!></span>');var v=t.from_html('<div class="textbox-wrapper svelte-1l9u2si"><!></div>');function m(e,a){t.push(a,!0);const[p,r]=t.setup_stores(),{styleable:l}=(0,o.getContext)("sdk"),n=(0,o.getContext)("component");let s=t.prop(a,"value",3,""),i=t.prop(a,"disabled",3,!1),c=t.prop(a,"copyLabel",3,"Copy to clipboard"),d=t.prop(a,"copiedLabel",3,"Copied !"),m=t.prop(a,"wrap",3,!1),g=t.prop(a,"monospace",3,!0);function f(e){a.onCopy?.(e)}var h=v(),_=t.child(h);{let e=t.derived(()=>a.onCopy?f:void 0);!function(e,o){t.push(o,!0);let a=t.prop(o,"value",3,""),p=t.prop(o,"align",3,"left"),r=t.prop(o,"disabled",3,!1),l=t.prop(o,"copyable",3,!1),n=t.prop(o,"copyIcon",3,"always"),s=t.prop(o,"copyLabel",3,"Copy to clipboard"),i=t.prop(o,"copiedLabel",3,"Copied !"),c=t.prop(o,"wrap",3,!1),d=t.prop(o,"justCopied",15,!1),v=t.prop(o,"monospace",3,!1),m=t.state(void 0),g=t.derived(()=>String(a()??"").trim()),f=t.derived(()=>o.icon?`ph ph-${o.icon}`:null),h=t.derived(()=>d()?"ph ph-check":"ph ph-copy");function _(){if(r()||!t.get(g)||d()||!l())return;const e=window.getSelection()?.toString()||"";o.oncopy?o.oncopy({value:t.get(g)}):navigator.clipboard.writeText(e||t.get(g)).then(()=>{d(!0),clearTimeout(t.get(m)),t.set(m,setTimeout(()=>{d(!1)},400),!0)}).catch(e=>{console.error("Failed to copy to clipboard:",e)})}t.user_effect(()=>()=>{clearTimeout(t.get(m))});var x=y();let C;var w=t.child(x),O=e=>{var o=u();t.template_effect(()=>t.set_class(o,1,t.get(f)+" textbox-icon","svelte-826hul")),t.append(e,o)};t.if(w,e=>{t.get(f)&&e(O)});var S=t.sibling(w,2);let T;var k=t.child(S,!0);t.reset(S);var M=t.sibling(S,2),j=e=>{var o=b();let a;t.template_effect(()=>a=t.set_class(o,1,t.clsx(t.get(h)),"svelte-826hul",a,{copied:d(),"copy-icon":copy-icon})),t.append(e,o)};t.if(M,e=>{l()&&e(j)}),t.reset(x),t.template_effect(()=>{C=t.set_class(x,1,"textbox value svelte-826hul",null,C,{copyable:l(),copied:d(),disabled:r(),"icon-on-hover":"onhover"===n()&&"right"!==p(),wrap:c(),monospace:v()}),t.set_attribute(x,"tabindex",r()?-1:0),t.set_attribute(x,"title",l()?d()?i():s():void 0),T=t.set_class(S,1,"textbox-text svelte-826hul",null,T,{wrap:c()}),t.set_style(S,`text-align: ${p()??""}`),t.set_text(k,t.get(g))}),t.event("click",x,_),t.event("keydown",x,function(e){!r()&&l()&&("Enter"!==e.key&&" "!==e.key||d()||(e.preventDefault(),_()))}),t.append(e,x),t.pop()}(_,{get value(){return s()},get disabled(){return i()},copyable:!0,get copyLabel(){return c()},get copiedLabel(){return d()},get wrap(){return m()},get monospace(){return g()},get oncopy(){return t.get(e)}})}t.reset(h),t.action(h,(e,t)=>l?.(e,t),()=>t.store_get(n,"$component",p).styles),t.append(e,h),t.pop(),r()}var g=t.from_html('<span class="plugin-error-detail svelte-1q1ah0h"> </span>'),f=t.from_html('<div class="plugin-error svelte-1q1ah0h" role="alert"><span class="plugin-error-title svelte-1q1ah0h">Textbox failed to render</span> <!></div>');function h(e,o){let a=t.rest_props(o,["$$slots","$$events","$$legacy"]);var p=t.comment(),r=t.first_child(p);{const e=(e,o=t.noop)=>{var a=f(),p=t.sibling(t.child(a),2),r=e=>{var a=g(),p=t.child(a,!0);t.reset(a),t.template_effect(()=>t.set_text(p,o().message)),t.append(e,a)};t.if(p,e=>{o()instanceof Error&&o().message&&e(r)}),t.reset(a),t.append(e,a)};t.boundary(r,{onerror:e=>{console.error("[SuperTextbox]",e)},failed:e},e=>{m(e,t.spread_props(()=>a))})}t.append(e,p)}var _={type:"component",metadata:{svelteMajor:5},schema:{name:"bb_component_supertextbox",friendlyName:"Super Textbox",description:"A styled copyable text display powered by the shared Textbox component",icon:"Text",hasChildren:!1,showEmptyState:!1,styles:["padding","size","border","background"],settings:[{type:"text",key:"value",label:"Value",defaultValue:"Copy me"},{type:"boolean",key:"disabled",label:"Disabled",defaultValue:!1},{type:"boolean",key:"wrap",label:"Wrap",defaultValue:!1},{type:"boolean",key:"monospace",label:"Monospace",defaultValue:!0},{section:!0,name:"Copy Settings",collapsed:!0,settings:[{type:"text",key:"copyLabel",label:"Copy Tooltip",defaultValue:"Copy to clipboard"},{type:"text",key:"copiedLabel",label:"Copied Message",defaultValue:"Copied !"}]},{type:"event",key:"onCopy",label:"On Copy",context:[{key:"value",label:"Value"}]}]}},x="1.0.1";if(window){const e={Component:h,schema:_,version:x};window["##BUDIBASE_CUSTOM_COMPONENTS##"]||(window["##BUDIBASE_CUSTOM_COMPONENTS##"]=[]),window["##BUDIBASE_CUSTOM_COMPONENTS##"].push(e),window.registerCustomComponent&&window.registerCustomComponent(e)}var C=h,w=x;return e.Component=C,e.schema=_,e.version=w,e}({},svelteInternal,svelte);
@@ -0,0 +1,78 @@
1
+ {
2
+ "type": "component",
3
+ "metadata": {
4
+ "svelteMajor": 5
5
+ },
6
+ "schema": {
7
+ "name": "bb_component_supertextbox",
8
+ "friendlyName": "Super Textbox",
9
+ "description": "A styled copyable text display powered by the shared Textbox component",
10
+ "icon": "Text",
11
+ "hasChildren": false,
12
+ "showEmptyState": false,
13
+ "styles": [
14
+ "padding",
15
+ "size",
16
+ "border",
17
+ "background"
18
+ ],
19
+ "settings": [
20
+ {
21
+ "type": "text",
22
+ "key": "value",
23
+ "label": "Value",
24
+ "defaultValue": "Copy me"
25
+ },
26
+ {
27
+ "type": "boolean",
28
+ "key": "disabled",
29
+ "label": "Disabled",
30
+ "defaultValue": false
31
+ },
32
+ {
33
+ "type": "boolean",
34
+ "key": "wrap",
35
+ "label": "Wrap",
36
+ "defaultValue": false
37
+ },
38
+ {
39
+ "type": "boolean",
40
+ "key": "monospace",
41
+ "label": "Monospace",
42
+ "defaultValue": true
43
+ },
44
+ {
45
+ "section": true,
46
+ "name": "Copy Settings",
47
+ "collapsed": true,
48
+ "settings": [
49
+ {
50
+ "type": "text",
51
+ "key": "copyLabel",
52
+ "label": "Copy Tooltip",
53
+ "defaultValue": "Copy to clipboard"
54
+ },
55
+ {
56
+ "type": "text",
57
+ "key": "copiedLabel",
58
+ "label": "Copied Message",
59
+ "defaultValue": "Copied !"
60
+ }
61
+ ]
62
+ },
63
+ {
64
+ "type": "event",
65
+ "key": "onCopy",
66
+ "label": "On Copy",
67
+ "context": [
68
+ {
69
+ "key": "value",
70
+ "label": "Value"
71
+ }
72
+ ]
73
+ }
74
+ ]
75
+ },
76
+ "hash": "ee9f35647c50457eb13849422a506080f52ec15a",
77
+ "version": "1.0.1"
78
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "bb_component_supertextbox",
3
+ "version": "1.0.1",
4
+ "description": "Super Textbox",
5
+ "author": "Michael Poirazi - https://github.com/poirazis",
6
+ "license": "MIT",
7
+ "svelte": "index.js",
8
+ "module": "dist/plugin.min.js",
9
+ "schema.metadata.svelteMajor": 5,
10
+ "type": "module",
11
+ "files": [
12
+ "dist/",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "vite build",
17
+ "watch": "NODE_ENV=development vite build --watch --mode development"
18
+ },
19
+ "dependencies": {
20
+ "@poirazis/superlib": "latest"
21
+ },
22
+ "exports": {
23
+ ".": {
24
+ "import": "./dist/plugin.min.js",
25
+ "require": "./dist/plugin.min.js"
26
+ }
27
+ },
28
+ "devDependencies": {
29
+ "@budibase/backend-core": "^3.38.5",
30
+ "@sveltejs/vite-plugin-svelte": "^7.1.2",
31
+ "tar": "^7.5.16",
32
+ "terser": "^5.48.0",
33
+ "vite": "^8.0.16",
34
+ "vite-plugin-css-injected-by-js": "^5.0.1",
35
+ "vite-plugin-singlefile": "^2.3.3",
36
+ "svelte": "5.55.10"
37
+ },
38
+ "peerDependencies": {
39
+ "svelte": "5.55.10"
40
+ },
41
+ "overrides": {
42
+ "svelte": "5.55.10"
43
+ }
44
+ }