Changeset 3658269
- Timestamp:
- 08/21/2026 06:23:16 AM (3 months ago)
- Location:
- import-spreadsheets-from-microsoft-excel
- Files:
-
- 2 deleted
- 18 edited
- 1 copied
-
tags/12.1.0 (copied) (copied from import-spreadsheets-from-microsoft-excel/trunk )
-
tags/12.1.0/build/block.json (modified) (1 diff)
-
tags/12.1.0/build/index.asset.php (modified) (1 diff)
-
tags/12.1.0/build/index.js (modified) (1 diff)
-
tags/12.1.0/build/render.php (modified) (1 diff)
-
tags/12.1.0/import-spreadsheets-from-microsoft-excel.php (modified) (2 diffs)
-
tags/12.1.0/includes/render-mount.php (modified) (2 diffs)
-
tags/12.1.0/includes/shortcode.php (modified) (4 diffs)
-
tags/12.1.0/includes/token.php (modified) (4 diffs)
-
tags/12.1.0/package.json (deleted)
-
tags/12.1.0/readme.txt (modified) (12 diffs)
-
trunk/build/block.json (modified) (1 diff)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/build/render.php (modified) (1 diff)
-
trunk/import-spreadsheets-from-microsoft-excel.php (modified) (2 diffs)
-
trunk/includes/render-mount.php (modified) (2 diffs)
-
trunk/includes/shortcode.php (modified) (4 diffs)
-
trunk/includes/token.php (modified) (4 diffs)
-
trunk/package.json (deleted)
-
trunk/readme.txt (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
import-spreadsheets-from-microsoft-excel/tags/12.1.0/build/block.json
r3642160 r3658269 3 3 "apiVersion": 3, 4 4 "name": "spreadsheetconverter/calculator", 5 "version": "12. 0.2",5 "version": "12.1.0", 6 6 "title": "SpreadsheetConverter Calculator", 7 7 "category": "embed", -
import-spreadsheets-from-microsoft-excel/tags/12.1.0/build/index.asset.php
r3642160 r3658269 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' 05e7c5419c67da5505b2');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'c349e8a445dcd1cd1b81'); -
import-spreadsheets-from-microsoft-excel/tags/12.1.0/build/index.js
r3642160 r3658269 1 (()=>{"use strict"; const e={n:t=>{const n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{if(Array.isArray(n))for(var s=0;s<n.length;){var r=n[s++],o=n[s++];e.o(t,r)?0===o&&s++:0===o?Object.defineProperty(t,r,{enumerable:!0,value:n[s++]}):Object.defineProperty(t,r,{enumerable:!0,get:o})}else for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.wp.blocks,n=window.wp.i18n,s=window.wp.element,r=window.wp.apiFetch;var o=e.n(r);const a=window.wp.blockEditor,l=window.wp.components,c=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,i=/^\/preview\/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})(?:\/|\.zip$|$)/,d=["localhost","127.0.0.1","[::1]","host.docker.internal"];function u(e,t){return e===t||e.endsWith("."+t)}function h(e,t){const n=t.replace(/^\/+|\/+$/g,"").split("/").filter(Boolean);return n.length&&n[n.length-1].includes(".")&&n.pop(),n.length?`${e}/${n.join("/")}`:e}const p=window.ReactJSXRuntime;function m({base:e,name:t}){const n=(0,s.useRef)(null);return(0,s.useEffect)(()=>{const t=n.current;if(!t||!e)return;const s=t.ownerDocument,r=s.defaultView,o=`${e}/assets/js/ssc.embed.js`,a=r.customElements&&r.customElements.get("ssc-calc"),l=s.querySelector(`script[src="${o}"]`);if(!a&&!l){const e=s.createElement("script");e.src=o,s.body.appendChild(e)}},[e]),(0,p.jsx)("div",{ref:n,children:(0,p.jsx)("ssc-calc",{name:t,"data-src":`${e}/embed.html`})})}const f=JSON.parse('{"UU":"spreadsheetconverter/calculator"}');(0,t.registerBlockType)(f.UU,{edit:function({attributes:e,setAttributes:t}){const{mode:r,src:f,name:w,token:v}=e,_=(0,a.useBlockProps)(),[k,b]=(0,s.useState)(v||""),[g,x]=(0,s.useState)(!1),[j,C]=(0,s.useState)(null),y="undefined"!=typeof window&&window.sscembedSettings&&!!window.sscembedSettings.allowLocalhost,S=function(e){switch(e.kind){case"conversion":return{action:"selfhost",message:null};case"cloud_permanent":return{action:"cloud",message:null};case"cloud_test":return{action:null,message:(0,n.__)("This is a temporary test link — click Publish to Cloud in Excel for a permanent one.","spreadsheetconverter")};default:return{action:null,message:(0,n.__)("That doesn't look like a SpreadsheetConverter link — copy it again from the Excel panel.","spreadsheetconverter")}}}(function(e,t={}){const n={kind:"unknown"};let s,r=(e||"").trim();if(""===r)return n;c.test(r)&&(r=`https://addin.spreadsheetconverter.com/preview/${r.toLowerCase()}/`);try{s=new URL(r)}catch(e){return n}const o=s.protocol.replace(":","").toLowerCase(),a=s.hostname.toLowerCase(),l=s.pathname||"/",p=d.includes(a);if(p&&!t.allowLocalhost)return n;if("https"!==o&&(!p||"http"!==o))return n;const m=`${o}://${a}${s.port?":"+s.port:""}`;if(p||u(a,"spreadsheetconverter.com")){const e=i.exec(l);return e?{kind:"conversion",host:m,uuid:e[1].toLowerCase()}:n}return u(a,"spreadsheethosting.com")?l.replace(/^\/+|\/+$/g,"").split("/").includes("tmp")?{kind:"cloud_test"}:{kind:"cloud_permanent",base:h(m,l)}:n}(k,{allowLocalhost:y})),F=e=>{x(!1),C(e&&e.message?e.message:(0,n.__)("The request failed — please try again.","spreadsheetconverter"))};return r&&f?(0,p.jsxs)("div",{..._,children:[(0,p.jsx)(a.InspectorControls,{children:(0,p.jsxs)(l.PanelBody,{title:(0,n.__)("Calculator","spreadsheetconverter"),children:[(0,p.jsx)("p",{children:"selfhost"===r?(0,n.__)("Hosted on this site (same-origin, permanent).","spreadsheetconverter"):(0,n.__)("Linked to the SpreadsheetConverter cloud.","spreadsheetconverter")}),"selfhost"===r&&(0,p.jsx)("p",{children:(0,p.jsx)(l.ExternalLink,{href:`${f}/index.html`,children:(0,n.__)("Open the standalone test page","spreadsheetconverter")})}),(0,p.jsx)(l.Button,{variant:"secondary",onClick:()=>{t({mode:"",src:"",name:"",token:""}),b(""),C(null)},children:(0,n.__)("Replace calculator…","spreadsheetconverter")})]})}),(0,p.jsx)(m,{base:f,name:w})]}):(0,p.jsx)("div",{..._,children:(0,p.jsx)(l.Placeholder,{icon:"calculator",label:(0,n.__)("SpreadsheetConverter Calculator","spreadsheetconverter"),instructions:(0,n.__)("Paste the link you copied from the SpreadsheetConverter task pane in Excel (Copy link after Convert, or Copy permanent link after Publish to Cloud).","spreadsheetconverter"),children:(0,p.jsxs)("div",{style:{width:"100%"},children:[(0,p.jsx)(l.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,n.__)("Calculator link","spreadsheetconverter"),hideLabelFromVision:!0,placeholder:(0,n.__)("Paste calculator link…","spreadsheetconverter"),value:k,onChange:e=>{b(e),C(null)},disabled:g}),""!==k.trim()&&S.message&&(0,p.jsx)(l.Notice,{status:"warning",isDismissible:!1,children:S.message}),j&&(0,p.jsx)(l.Notice,{status:"error",isDismissible:!1,children:j}),"selfhost"===S.action&&(0,p.jsx)(l.Button,{variant:"primary",onClick:()=>{x(!0),C(null),o()({path:"/ssc/v1/host-calculator",method:"POST",data:{url:k}}).then(e=>{x(!1),t({mode:"selfhost",src:e.url,name:e.name,token:k})}).catch(F)},disabled:g,children:(0,n.__)("Host on this site","spreadsheetconverter")}),"cloud"===S.action&&(0,p.jsx)(l.Button,{variant:"primary",onClick:()=>{x(!0),C(null),o()({path:"/ssc/v1/inspect-cloud",method:"POST",data:{url:k}}).then(e=>{x(!1),t({mode:"cloud",src:e.base,name:e.name,token:k})}).catch(F)},disabled:g,children:(0,n.__)("Link to the cloud","spreadsheetconverter")}),g&&(0,p.jsx)(l.Spinner,{}),(0,p.jsx)("div",{style:{marginTop:"8px"},children:(0,p.jsx)(l.FormFileUpload,{accept:".zip,application/zip",onChange:e=>{const n=e.target.files&&e.target.files[0];if(!n)return;x(!0),C(null);const s=new window.FormData;s.append("bundle",n),o()({path:"/ssc/v1/host-upload",method:"POST",body:s}).then(e=>{x(!1),t({mode:"selfhost",src:e.url,name:e.name,token:""})}).catch(F)},disabled:g,render:({openFileDialog:e})=>(0,p.jsx)(l.Button,{variant:"link",onClick:e,disabled:g,children:(0,n.__)("…or upload a downloaded calculator zip (offline fallback)","spreadsheetconverter")})})})]})})})},save:function(){return null}})})();1 (()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,r=window.wp.i18n,n=window.wp.element,s=window.wp.apiFetch;var o=e.n(s);const a=window.wp.blockEditor,c=window.wp.components,l=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,i=/^\/preview\/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})(?:\/|\.zip$|$)/,d=["localhost","127.0.0.1","[::1]","host.docker.internal"];function u(e,t){return e===t||e.endsWith("."+t)}function p(e,t={}){const r={kind:"unknown"};let n,s=(e||"").trim();if(""===s)return r;l.test(s)&&(s=`https://addin.spreadsheetconverter.com/preview/${s.toLowerCase()}/`);try{n=new URL(s)}catch(e){return r}const o=n.hostname.toLowerCase(),a=d.includes(o);if(a&&!t.allowLocalhost)return r;const c=n.protocol.replace(":","").toLowerCase();if("https"!==c&&(!a||"http"!==c))return r;const p=n.pathname||"/",m=`${c}://${o}${n.port?":"+n.port:""}`,f=u(o,"server.spreadsheetconverter.com");if(f||a){const e=function(e,t,r){const n=/^(\/t\/[^/]+)?\/forms\/([^/]+)(?:\/([^/]+))?\/?$/.exec(t);if(!n)return null;const s=n[1]||"",o=n[2],a=n[3]||"";let c="";if(""!==a&&"embed.html"!==a){if(["records","manifest","embed.css","calc.client.js","ssc.embed.js"].includes(a)||!/^\d+$/.test(a))return{kind:"server_notform"};c=a}const l=`${e}${s}/forms/${o}`;let i=r;return""!==c&&(i=`record=${encodeURIComponent(c)}${i?"&"+i:""}`),{kind:"server",base:l,name:decodeURIComponent(o),embed:`${l}/embed.html${i?"?"+i:""}`,page:l+(""!==c?"/"+c:""),script:`${l}/ssc.embed.js`}}(m,p,n.search.replace(/^\?/,""));if(e)return e;if(f)return{kind:"server_notform"}}if(a||u(o,"spreadsheetconverter.com")){const e=i.exec(p);return e?{kind:"conversion",host:m,uuid:e[1].toLowerCase()}:r}return u(o,"spreadsheethosting.com")?p.replace(/^\/+|\/+$/g,"").split("/").includes("tmp")?{kind:"cloud_test"}:{kind:"cloud_permanent",base:h(m,p)}:r}function h(e,t){const r=t.replace(/^\/+|\/+$/g,"").split("/").filter(Boolean);return r.length&&r[r.length-1].includes(".")&&r.pop(),r.length?`${e}/${r.join("/")}`:e}const m=window.ReactJSXRuntime;function f({base:e,name:t,script:r,embedSrc:s}){const o=(0,n.useRef)(null),a=r||`${e}/assets/js/ssc.embed.js`;return(0,n.useEffect)(()=>{const t=o.current;if(!t||!e)return;const r=t.ownerDocument,n=r.defaultView,s=n.customElements&&n.customElements.get("ssc-calc"),c=r.querySelector(`script[src="${a}"]`);if(!s&&!c){const e=r.createElement("script");e.src=a,r.body.appendChild(e)}},[e,a]),(0,m.jsx)("div",{ref:o,children:(0,m.jsx)("ssc-calc",{name:t,"data-src":s||`${e}/embed.html`})})}const v=JSON.parse('{"UU":"spreadsheetconverter/calculator"}');(0,t.registerBlockType)(v.UU,{edit:function({attributes:e,setAttributes:t}){const{mode:s,src:l,name:i,token:d}=e,u=(0,a.useBlockProps)(),[h,v]=(0,n.useState)(d||""),[_,w]=(0,n.useState)(!1),[b,k]=(0,n.useState)(null),x="undefined"!=typeof window&&window.sscembedSettings&&!!window.sscembedSettings.allowLocalhost,g=p(h,{allowLocalhost:x}),j=function(e){switch(e.kind){case"conversion":return{action:"selfhost",message:null};case"cloud_permanent":return{action:"cloud",message:null};case"server":return{action:"server",message:null};case"server_notform":return{action:null,message:(0,r.__)("Paste the form's own link — the address 'Open your form' opens in Excel (…/forms/your-form). Records lists, Properties pages and private links can't be embedded.","spreadsheetconverter")};case"cloud_test":return{action:null,message:(0,r.__)("This is a temporary test link — click Publish to Cloud in Excel for a permanent one.","spreadsheetconverter")};default:return{action:null,message:(0,r.__)("That doesn't look like a SpreadsheetConverter link — copy it again from the Excel panel.","spreadsheetconverter")}}}(g),C=e=>{w(!1),k(e&&e.message?e.message:(0,r.__)("The request failed — please try again.","spreadsheetconverter"))},$=()=>{t({mode:"",src:"",name:"",token:""}),v(""),k(null)};if(s&&l){const e="server"===s?p(d,{allowLocalhost:x}):null,t=(()=>{try{return new URL(l).hostname}catch(e){return l}})();let n=(0,r.__)("Linked to the SpreadsheetConverter cloud.","spreadsheetconverter");return"selfhost"===s?n=(0,r.__)("Hosted on this site (same-origin, permanent).","spreadsheetconverter"):"server"===s&&(n=`${(0,r.__)("Server form","spreadsheetconverter")} · ${i} · ${(0,r.__)("Embedded from","spreadsheetconverter")} ${t}`),(0,m.jsxs)("div",{...u,children:[(0,m.jsx)(a.InspectorControls,{children:(0,m.jsxs)(c.PanelBody,{title:(0,r.__)("Calculator","spreadsheetconverter"),children:[(0,m.jsx)("p",{children:n}),"selfhost"===s&&(0,m.jsx)("p",{children:(0,m.jsx)(c.ExternalLink,{href:`${l}/index.html`,children:(0,r.__)("Open the standalone test page","spreadsheetconverter")})}),(0,m.jsx)(c.Button,{variant:"secondary",onClick:$,children:(0,r.__)("Replace calculator…","spreadsheetconverter")})]})}),(0,m.jsx)(f,{base:l,name:i,script:e&&"server"===e.kind?e.script:void 0,embedSrc:e&&"server"===e.kind?e.embed:void 0})]})}return(0,m.jsx)("div",{...u,children:(0,m.jsx)(c.Placeholder,{icon:"calculator",label:(0,r.__)("SpreadsheetConverter Calculator","spreadsheetconverter"),instructions:(0,r.__)("Paste the link you copied from the SpreadsheetConverter task pane in Excel (Copy link after Publish to the Server, Copy link after Convert, or Copy permanent link after Publish to Cloud).","spreadsheetconverter"),children:(0,m.jsxs)("div",{style:{width:"100%"},children:[(0,m.jsx)(c.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,r.__)("Calculator link","spreadsheetconverter"),hideLabelFromVision:!0,placeholder:(0,r.__)("Paste calculator link…","spreadsheetconverter"),value:h,onChange:e=>{v(e),k(null)},disabled:_}),""!==h.trim()&&j.message&&(0,m.jsx)(c.Notice,{status:"warning",isDismissible:!1,children:j.message}),b&&(0,m.jsx)(c.Notice,{status:"error",isDismissible:!1,children:b}),"selfhost"===j.action&&(0,m.jsx)(c.Button,{variant:"primary",onClick:()=>{w(!0),k(null),o()({path:"/ssc/v1/host-calculator",method:"POST",data:{url:h}}).then(e=>{w(!1),t({mode:"selfhost",src:e.url,name:e.name,token:h})}).catch(C)},disabled:_,children:(0,r.__)("Host on this site","spreadsheetconverter")}),"cloud"===j.action&&(0,m.jsx)(c.Button,{variant:"primary",onClick:()=>{w(!0),k(null),o()({path:"/ssc/v1/inspect-cloud",method:"POST",data:{url:h}}).then(e=>{w(!1),t({mode:"cloud",src:e.base,name:e.name,token:h})}).catch(C)},disabled:_,children:(0,r.__)("Link to the cloud","spreadsheetconverter")}),"server"===j.action&&(0,m.jsx)(c.Button,{variant:"primary",onClick:()=>{t({mode:"server",src:g.base,name:g.name,token:h})},disabled:_,children:(0,r.__)("Embed from the Server","spreadsheetconverter")}),_&&(0,m.jsx)(c.Spinner,{}),(0,m.jsx)("div",{style:{marginTop:"8px"},children:(0,m.jsx)(c.FormFileUpload,{accept:".zip,application/zip",onChange:e=>{const r=e.target.files&&e.target.files[0];if(!r)return;w(!0),k(null);const n=new window.FormData;n.append("bundle",r),o()({path:"/ssc/v1/host-upload",method:"POST",body:n}).then(e=>{w(!1),t({mode:"selfhost",src:e.url,name:e.name,token:""})}).catch(C)},disabled:_,render:({openFileDialog:e})=>(0,m.jsx)(c.Button,{variant:"link",onClick:e,disabled:_,children:(0,r.__)("…or upload a downloaded calculator zip (offline fallback)","spreadsheetconverter")})})})]})})})},save:function(){return null}})})(); -
import-spreadsheets-from-microsoft-excel/tags/12.1.0/build/render.php
r3587470 r3658269 24 24 25 25 // Not configured yet (no validated source) — render nothing on the page. 26 if ( '' === $sscembed_base || ! in_array( $sscembed_mode, array( 'selfhost', 'cloud' ), true ) ) {26 if ( '' === $sscembed_base || ! in_array( $sscembed_mode, array( 'selfhost', 'cloud', 'server' ), true ) ) { 27 27 return; 28 28 } 29 29 30 $sscembed_m = sscembed_render_mount( $sscembed_base, $sscembed_name ); 30 if ( 'server' === $sscembed_mode ) { 31 // sss8-form-embed-on-external-site step 1.5: re-classify the stored token 32 // server-side — the client's classification is never trusted. A tampered 33 // `src` riding a non-server token renders nothing. 34 $sscembed_c = sscembed_classify_url( 35 isset( $attributes['token'] ) ? (string) $attributes['token'] : '', 36 array( 37 'allow_localhost' => function_exists( 'sscembed_allow_localhost' ) && sscembed_allow_localhost(), 38 ) 39 ); 40 if ( 'server' !== $sscembed_c['kind'] ) { 41 return; 42 } 43 $sscembed_m = sscembed_render_mount( 44 $sscembed_c['base'], 45 '' !== $sscembed_name ? $sscembed_name : $sscembed_c['name'], 46 $sscembed_c['script'], 47 $sscembed_c['embed'] 48 ); 49 } else { 50 $sscembed_m = sscembed_render_mount( $sscembed_base, $sscembed_name ); 51 } 31 52 32 53 wp_enqueue_script( -
import-spreadsheets-from-microsoft-excel/tags/12.1.0/import-spreadsheets-from-microsoft-excel.php
r3642160 r3658269 4 4 * Plugin URI: https://www.spreadsheetconverter.com/ 5 5 * Description: Embed live, calculating web pages converted from Excel by SpreadsheetConverter — inline in your theme, no iframe. 6 * Version: 12. 0.26 * Version: 12.1.0 7 7 * Requires at least: 6.5 8 8 * Requires PHP: 7.4 … … 18 18 defined( 'ABSPATH' ) || exit; 19 19 20 define( 'SSCEMBED_VERSION', '12. 0.2' );20 define( 'SSCEMBED_VERSION', '12.1.0' ); 21 21 define( 'SSCEMBED_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 22 22 define( 'SSCEMBED_PLUGIN_FILE', __FILE__ ); -
import-spreadsheets-from-microsoft-excel/tags/12.1.0/includes/render-mount.php
r3587470 r3658269 22 22 * Build the two-line mount for a hosted bundle base URL. 23 23 * 24 * @param string $base Directory base URL (same-origin uploads dir for 25 * self-host, cloud directory for cloud-link). 26 * @param string $name Workbook name, opaque. 24 * @param string $base Directory base URL (same-origin uploads dir 25 * for self-host, cloud directory for 26 * cloud-link, form base for a Server form). 27 * @param string $name Workbook name, opaque. 28 * @param string|null $script_url Bootstrap URL override. The Server serves 29 * ssc.embed.js as a SIBLING of embed.html 30 * (<base>/ssc.embed.js); default keeps the 31 * classic bundle layout (assets/js/…). 32 * @param string|null $data_src Mount data-src override — a Server record 33 * link mounts <base>/embed.html?record=<id>. 34 * Default keeps <base>/embed.html. 27 35 * @return array { 28 36 * @type string $mount The <ssc-calc> element line. … … 32 40 * } 33 41 */ 34 function sscembed_render_mount( $base, $name ) {42 function sscembed_render_mount( $base, $name, $script_url = null, $data_src = null ) { 35 43 $base = untrailingslashit( trim( (string) $base ) ); 36 44 37 45 $mount = '<ssc-calc name="' . esc_attr( $name ) . '" data-src="' 38 . esc_url( $base . '/embed.html' ) . '"></ssc-calc>';46 . esc_url( null !== $data_src ? $data_src : $base . '/embed.html' ) . '"></ssc-calc>'; 39 47 40 48 return array( 41 49 'mount' => $mount, 42 'script_url' => $base . '/assets/js/ssc.embed.js',50 'script_url' => null !== $script_url ? $script_url : $base . '/assets/js/ssc.embed.js', 43 51 ); 44 52 } -
import-spreadsheets-from-microsoft-excel/tags/12.1.0/includes/shortcode.php
r3587470 r3658269 13 13 * the block or REST) -> same-origin mount; 14 14 * * permanent cloud URL -> cloud mount; 15 * * Server form link -> Server mount (bootstrap is 16 * the embed.html sibling; record links carry 17 * ?record on the data-src); 15 18 * * anything else (incl. /tmp/ test links, garbage, 16 * never-hosted conversions ) -> no mount, an HTML17 * comment explains why (explicit, no silent18 * coercion).19 * never-hosted conversions, non-form Server 20 * links) -> no mount, an HTML comment explains 21 * why (explicit, no silent coercion). 19 22 * 20 23 * @package SpreadsheetConverter … … 40 43 ); 41 44 42 $base = ''; 43 $name = (string) $atts['name']; 45 $base = ''; 46 $name = (string) $atts['name']; 47 $script_url = null; 48 $data_src = null; 44 49 45 50 if ( '' !== $atts['src'] ) { … … 67 72 } elseif ( 'cloud_permanent' === $classified['kind'] ) { 68 73 $base = $classified['base']; 74 } elseif ( 'server' === $classified['kind'] ) { 75 // sss8-form-embed-on-external-site step 1.5: the Server form 76 // mounts straight off the Server — sibling bootstrap, and a 77 // record link's ?record query rides the data-src. 78 $base = $classified['base']; 79 $script_url = $classified['script']; 80 $data_src = $classified['embed']; 81 if ( '' === $name ) { 82 $name = $classified['name']; 83 } 84 } elseif ( 'server_notform' === $classified['kind'] ) { 85 return "\n<!-- ssc_calc: paste the form's own link (.../forms/your-form) - Records lists, Properties pages and private links can't be embedded. -->\n"; 69 86 } elseif ( 'cloud_test' === $classified['kind'] ) { 70 87 return "\n<!-- ssc_calc: temporary Test-in-Cloud links cannot be embedded - use Publish to Cloud in Excel for a permanent one. -->\n"; … … 78 95 } 79 96 80 $mount = sscembed_render_mount( $base, $name );97 $mount = sscembed_render_mount( $base, $name, $script_url, $data_src ); 81 98 82 99 wp_enqueue_script( -
import-spreadsheets-from-microsoft-excel/tags/12.1.0/includes/token.php
r3587470 r3658269 9 9 * classify as `unknown` and never be fetched. 10 10 * 11 * Kinds (explicit 4-way return, no default-swallow):11 * Kinds (explicit 6-way return, no default-swallow): 12 12 * conversion — allow-listed convert host + /preview/<uuid>/ path 13 13 * (the short-lived preview link Convert produces) … … 16 16 * cloud_permanent — *.spreadsheethosting.com without /tmp/ (Publish to 17 17 * Cloud, keepdays=-1) 18 * server — server.spreadsheetconverter.com form link 19 * ([/t/<slug>]/forms/<name>[/<record>|/embed.html]) — 20 * mounted straight off the Server, nothing fetched 21 * server_notform — a Server link that is not a form's own address 22 * (records list, Properties page, capability link, …) 18 23 * unknown — anything else, including any off-allow-list host 19 24 * … … 115 120 $origin = $scheme . '://' . $host . ( isset( $parts['port'] ) ? ':' . $parts['port'] : '' ); 116 121 122 // --- Server form: server.spreadsheetconverter.com (sss8) -------------- 123 // MUST sit ABOVE the conversion branch: the server host also matches 124 // 'spreadsheetconverter.com' and would fall to `unknown` there. The 125 // localhost dev opt-in reaches a dev Server the same way it reaches a 126 // dev convert host — by path shape. 127 $is_server_host = sscembed_host_matches( $host, 'server.spreadsheetconverter.com' ); 128 if ( $is_server_host || $is_localhost ) { 129 $server = sscembed_classify_server_path( 130 $origin, 131 $path, 132 isset( $parts['query'] ) ? $parts['query'] : '' 133 ); 134 if ( null !== $server ) { 135 return $server; 136 } 137 if ( $is_server_host ) { 138 // A Server link that is not a form — records list, Properties 139 // page, capability link, space root. Corrective message, never 140 // a silent fall-through to `unknown`. 141 return array( 'kind' => 'server_notform' ); 142 } 143 } 144 117 145 // --- conversion: allow-listed convert host + /preview/<uuid>/ --------- 118 146 if ( $is_localhost || sscembed_host_matches( $host, 'spreadsheetconverter.com' ) ) { … … 143 171 144 172 /** 173 * Classify a path on the Server host against sss8's route grammar: 174 * [/t/<slug>]/forms/<name>[/<last>], apex or tenant-prefixed. 175 * 176 * <last> may be a record id (digits — carried onto the embed URL as 177 * ?record=<id>), the embed.html address itself, or a reserved sibling 178 * (records list, Properties manifest, the bundle assets) which is NOT a 179 * form. The pasted query string (?view=1) passes through to the embed URL. 180 * The name is URL-decoded for display, never re-slugged. 181 * 182 * @param string $origin scheme://host[:port]. 183 * @param string $path URL path. 184 * @param string $query Raw query string (may be ''). 185 * @return array|null server / server_notform classification, or null when 186 * the path is not under /forms/ at all. 187 */ 188 function sscembed_classify_server_path( $origin, $path, $query ) { 189 if ( ! preg_match( '#^(/t/[^/]+)?/forms/([^/]+)(?:/([^/]+))?/?$#', $path, $m ) ) { 190 return null; 191 } 192 $prefix = isset( $m[1] ) ? $m[1] : ''; 193 $name = $m[2]; 194 $last = isset( $m[3] ) ? $m[3] : ''; 195 196 $record = ''; 197 if ( '' !== $last && 'embed.html' !== $last ) { 198 $reserved = array( 'records', 'manifest', 'embed.css', 'calc.client.js', 'ssc.embed.js' ); 199 if ( in_array( $last, $reserved, true ) || ! preg_match( '/^\d+$/', $last ) ) { 200 return array( 'kind' => 'server_notform' ); 201 } 202 $record = $last; 203 } 204 205 $base = $origin . $prefix . '/forms/' . $name; 206 $qs = $query; 207 if ( '' !== $record ) { 208 $qs = 'record=' . rawurlencode( $record ) . ( '' !== $qs ? '&' . $qs : '' ); 209 } 210 211 return array( 212 'kind' => 'server', 213 'base' => $base, 214 'name' => rawurldecode( $name ), 215 'embed' => $base . '/embed.html' . ( '' !== $qs ? '?' . $qs : '' ), 216 'page' => $base . ( '' !== $record ? '/' . $record : '' ), 217 'script' => $base . '/ssc.embed.js', 218 ); 219 } 220 221 /** 145 222 * Directory base of a pasted cloud URL: drop a trailing file segment (one 146 223 * containing a dot), keep directory segments, no trailing slash. -
import-spreadsheets-from-microsoft-excel/tags/12.1.0/readme.txt
r3642160 r3658269 3 3 Tags: calculator, excel, spreadsheet, form, embed 4 4 Requires at least: 6.5 5 Tested up to: 7. 05 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 12. 0.27 Stable tag: 12.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 24 24 https://addin.spreadsheetconverter.com/install 25 25 26 **Two hosting modes:** 27 28 * **Host on this site (recommended)** — paste the conversion link copied 29 from the SpreadsheetConverter task pane in Excel and click *Host on this 26 **Three hosting modes:** 27 28 * **Server form (recommended)** — click *Publish to the Server* in Excel 29 (SpreadsheetConverter Server), then *Copy link*, and paste it. The form 30 mounts inline on your page straight from the Server — calculating live, 31 **saving what visitors type as records on the Server**, no Server menus, 32 no iframe. Any conversion flavor works; you do not need the Embeddable 33 option for this mode. 34 * **Host on this site** — paste the conversion link copied from the 35 SpreadsheetConverter task pane in Excel and click *Host on this 30 36 site*. WordPress fetches the calculator from the SpreadsheetConverter 31 37 cloud and stores it inside your own site … … 47 53 == External services == 48 54 49 This plugin connects to the SpreadsheetConverter cloud in twosituations,50 both initiated explicitly by an editor — never on a public page view in55 This plugin connects to SpreadsheetConverter services in three situations, 56 each initiated explicitly by an editor — never on a public page view in 51 57 self-host mode: 52 58 … … 60 66 configuring the block, the WordPress server fetches the published 61 67 calculator's index page once to read its name. 68 3. **Server form** — the page embeds the form directly from 69 SpreadsheetConverter Server (`server.spreadsheetconverter.com`); 70 visitors' browsers request the form and its assets from that host, and 71 what a visitor types into the form is saved as a record on the Server 72 (that is the product: a saving form). Nothing is fetched by your 73 WordPress server in this mode. 62 74 63 75 Both services are provided by Framtidsforum I&M AB (SpreadsheetConverter). … … 78 90 SpreadsheetConverter). 79 91 3. **Sign in** if prompted (required to convert). 80 4. **Select Flavor = HTML and tick the Embeddable checkbox, then press 81 Convert.** The **Embeddable** option is required — it produces the inline 82 bundle the block embeds without an iframe; a non-embeddable conversion (or 83 another flavor) will not work in the block. The spreadsheet becomes an 84 interactive web calculator (a few seconds) and a preview opens 85 automatically in a new browser tab. 86 5. **Get the link to paste into WordPress.** On the green **Converted** card, 87 open **▸ More options**: 88 * To host it on your own WordPress site (recommended): under **WordPress**, 89 press **Copy link** — the short-lived conversion link (use it within a 90 few minutes). 92 4. **Press Convert.** For the recommended Server mode any flavor is fine — 93 the Server compiles the workbook itself. For *Host on this site* or 94 *Link to the cloud* you must select **Flavor = HTML and tick the 95 Embeddable checkbox** first — those two modes embed the converted bundle, 96 and only an Embeddable HTML conversion produces it. The spreadsheet 97 becomes an interactive web calculator (a few seconds). 98 5. **Get the link to paste into WordPress.** On the green **Converted** card: 99 * *Recommended:* press **Publish to the Server**, then **Copy link** on 100 the *Published to the Server* card — a permanent link to your form on 101 SpreadsheetConverter Server (visitors' entries are saved as records 102 there). 103 * To host it on your own WordPress site: under **▸ More options → 104 WordPress**, press **Copy link** — the short-lived conversion link (use 105 it within a few minutes). 91 106 * To link to the SpreadsheetConverter cloud instead: under **Classic 92 107 cloud**, press **Publish to cloud**, then copy the permanent link. Only a … … 94 109 "Test in cloud" link (its address contains `/tmp/`) is rejected by the 95 110 block. 96 * In both casesyou paste the **whole link** and the block double-checks111 * In every case you paste the **whole link** and the block double-checks 97 112 it. Nothing is downloaded to your computer. 98 * Not for WordPress: a **Publish to Server** link (address on99 `server.spreadsheetconverter.com`) — the block accepts only the two100 links above.101 113 102 114 = Part 2 — Add it to your WordPress page = … … 109 121 8. **Paste your link.** The block recognizes the link type and offers the 110 122 matching option: 111 * Conversion link → **Host on this site** (recommended). Click it. 123 * Server form link (`…/forms/your-form`, a record link 124 `…/forms/your-form/17`, or the `…/embed.html` address itself) → 125 **Embed from the Server** (recommended). Click it. The form mounts 126 inline straight from the Server — no Server header, menu or records 127 row, just the form, styled by your theme. 128 * Conversion link → **Host on this site**. Click it. 112 129 WordPress fetches your calculator and stores it inside your own site. 113 130 * Publish-to-Cloud link → **Link to the cloud.** The calculator stays … … 116 133 temporary test link — click Publish to Cloud in Excel for a permanent 117 134 one."* 135 * A Server link that is not a form (a Records list, a Properties page, 136 a private link) → *"Paste the form's own link — the address 'Open 137 your form' opens in Excel (…/forms/your-form). Records lists, 138 Properties pages and private links can't be embedded."* 118 139 * Anything unrecognized → *"That doesn't look like a 119 140 SpreadsheetConverter link — copy it again from the Excel panel."* … … 122 143 10. **Press Publish** (the WordPress button). The page goes live. 123 144 11. **View your live page.** It calculates, validates, moves between 124 sheets, and Submit works. 145 sheets, and Submit works. On a Server form, what a visitor types is 146 saved to the Server exactly as on the Server's own page: a small save 147 status sits at the top of the form, action buttons show their outcome 148 in the page, and you find the records under **Records** on the Server. 149 150 = Server forms — notes and limits = 151 152 * **One calculator per page** (all modes; the calculator is page-global). 153 * **Classic themes:** 154 `[ssc_calc token="https://server.spreadsheetconverter.com/t/acme/forms/order"]`. 155 * **Updating later:** re-publish to the Server — your page mounts the new 156 version on reload; nothing to change in WordPress. 157 * **Returning visitors:** in most browsers a visitor who comes back to your 158 page is recognized again (the Server keeps their identity in a partitioned 159 cookie) and continues with their earlier entry. A browser that refuses 160 partitioned cookies starts a fresh entry instead — the earlier one stays 161 safe on the Server. 162 * **No sign-in inside the mount:** a members-only form shows the Server's 163 refusal in the save status with a link to sign in on the Server's own 164 page. 165 * **Forms published before this release:** re-publish once so images inside 166 the form and returning-visitor recognition work in the mount (both ride a 167 per-form file that updates on publish). 168 * **Your site sends its own Content-Security-Policy?** Allow 169 `https://server.spreadsheetconverter.com` in `script-src`, `style-src`, 170 `img-src` and `connect-src` — the same four the cloud-link mode needs for 171 spreadsheethosting. WordPress itself sends no CSP by default. 172 * **Troubleshooting:** open `…/forms/your-form/embed.html` directly in a 173 browser. If it works there but not on your page, the issue is your page's 174 CSP, a plugin stripping the custom element, or a theme script clashing 175 with a global the calculator uses. 125 176 126 177 == Screenshots == … … 145 196 = My theme uses the classic editor — can I still embed? = 146 197 147 Yes: `[ssc_calc token="…"]` (a link you pasted/hosted via the block or a 148 permanent cloud link) or `[ssc_calc src="…"]` (the calculator's base URL). 198 Yes: `[ssc_calc token="…"]` (a link you pasted/hosted via the block, a 199 permanent cloud link, or a Server form link) or `[ssc_calc src="…"]` (the 200 calculator's base URL). 201 202 = What is the difference between a Server form and the other modes? = 203 204 A Server form is hosted on SpreadsheetConverter Server and **saves what 205 visitors type as records** you can review there — it is a form, not just a 206 calculator. The other two modes embed a static calculating page (self-hosted 207 or on the cloud); nothing is stored unless the workbook has its own Submit. 208 For other websites (Squarespace, Wix, plain HTML) the form's Properties page 209 on the Server shows the same two-line embed code to copy. 149 210 150 211 = How do I update the calculator later? = … … 177 238 178 239 == Changelog == 240 241 = 12.1.0 = 242 * New: **Server form** mode — paste a SpreadsheetConverter Server form link 243 (`…/forms/your-form`) and press *Embed from the Server*. The form mounts 244 inline in your theme (no iframe, no Server menus), calculates live, and 245 saves visitors' entries as records on the Server. Record links and 246 `?view=1` links work too. 247 * The `[ssc_calc]` shortcode accepts Server form links. 248 * Images and other assets inside an embedded calculator now load from the 249 calculator's own host in every mode (previously they could wrongly be 250 requested from your page's address). 251 * Clearer message when a pasted Server link is not a form's own address 252 (a Records list, a Properties page, a private link). 179 253 180 254 = 12.0.2 = … … 203 277 == Upgrade Notice == 204 278 279 = 12.1.0 = 280 New Server form mode: paste a Publish-to-Server link and embed a saving form 281 inline on your page. Existing embeds are untouched. 282 205 283 = 12.0.2 = 206 284 Minor editor polish: clearer placeholder in the block's link field. -
import-spreadsheets-from-microsoft-excel/trunk/build/block.json
r3642160 r3658269 3 3 "apiVersion": 3, 4 4 "name": "spreadsheetconverter/calculator", 5 "version": "12. 0.2",5 "version": "12.1.0", 6 6 "title": "SpreadsheetConverter Calculator", 7 7 "category": "embed", -
import-spreadsheets-from-microsoft-excel/trunk/build/index.asset.php
r3642160 r3658269 1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' 05e7c5419c67da5505b2');1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'c349e8a445dcd1cd1b81'); -
import-spreadsheets-from-microsoft-excel/trunk/build/index.js
r3642160 r3658269 1 (()=>{"use strict"; const e={n:t=>{const n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{if(Array.isArray(n))for(var s=0;s<n.length;){var r=n[s++],o=n[s++];e.o(t,r)?0===o&&s++:0===o?Object.defineProperty(t,r,{enumerable:!0,value:n[s++]}):Object.defineProperty(t,r,{enumerable:!0,get:o})}else for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.hasOwn(e,t)},t=window.wp.blocks,n=window.wp.i18n,s=window.wp.element,r=window.wp.apiFetch;var o=e.n(r);const a=window.wp.blockEditor,l=window.wp.components,c=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,i=/^\/preview\/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})(?:\/|\.zip$|$)/,d=["localhost","127.0.0.1","[::1]","host.docker.internal"];function u(e,t){return e===t||e.endsWith("."+t)}function h(e,t){const n=t.replace(/^\/+|\/+$/g,"").split("/").filter(Boolean);return n.length&&n[n.length-1].includes(".")&&n.pop(),n.length?`${e}/${n.join("/")}`:e}const p=window.ReactJSXRuntime;function m({base:e,name:t}){const n=(0,s.useRef)(null);return(0,s.useEffect)(()=>{const t=n.current;if(!t||!e)return;const s=t.ownerDocument,r=s.defaultView,o=`${e}/assets/js/ssc.embed.js`,a=r.customElements&&r.customElements.get("ssc-calc"),l=s.querySelector(`script[src="${o}"]`);if(!a&&!l){const e=s.createElement("script");e.src=o,s.body.appendChild(e)}},[e]),(0,p.jsx)("div",{ref:n,children:(0,p.jsx)("ssc-calc",{name:t,"data-src":`${e}/embed.html`})})}const f=JSON.parse('{"UU":"spreadsheetconverter/calculator"}');(0,t.registerBlockType)(f.UU,{edit:function({attributes:e,setAttributes:t}){const{mode:r,src:f,name:w,token:v}=e,_=(0,a.useBlockProps)(),[k,b]=(0,s.useState)(v||""),[g,x]=(0,s.useState)(!1),[j,C]=(0,s.useState)(null),y="undefined"!=typeof window&&window.sscembedSettings&&!!window.sscembedSettings.allowLocalhost,S=function(e){switch(e.kind){case"conversion":return{action:"selfhost",message:null};case"cloud_permanent":return{action:"cloud",message:null};case"cloud_test":return{action:null,message:(0,n.__)("This is a temporary test link — click Publish to Cloud in Excel for a permanent one.","spreadsheetconverter")};default:return{action:null,message:(0,n.__)("That doesn't look like a SpreadsheetConverter link — copy it again from the Excel panel.","spreadsheetconverter")}}}(function(e,t={}){const n={kind:"unknown"};let s,r=(e||"").trim();if(""===r)return n;c.test(r)&&(r=`https://addin.spreadsheetconverter.com/preview/${r.toLowerCase()}/`);try{s=new URL(r)}catch(e){return n}const o=s.protocol.replace(":","").toLowerCase(),a=s.hostname.toLowerCase(),l=s.pathname||"/",p=d.includes(a);if(p&&!t.allowLocalhost)return n;if("https"!==o&&(!p||"http"!==o))return n;const m=`${o}://${a}${s.port?":"+s.port:""}`;if(p||u(a,"spreadsheetconverter.com")){const e=i.exec(l);return e?{kind:"conversion",host:m,uuid:e[1].toLowerCase()}:n}return u(a,"spreadsheethosting.com")?l.replace(/^\/+|\/+$/g,"").split("/").includes("tmp")?{kind:"cloud_test"}:{kind:"cloud_permanent",base:h(m,l)}:n}(k,{allowLocalhost:y})),F=e=>{x(!1),C(e&&e.message?e.message:(0,n.__)("The request failed — please try again.","spreadsheetconverter"))};return r&&f?(0,p.jsxs)("div",{..._,children:[(0,p.jsx)(a.InspectorControls,{children:(0,p.jsxs)(l.PanelBody,{title:(0,n.__)("Calculator","spreadsheetconverter"),children:[(0,p.jsx)("p",{children:"selfhost"===r?(0,n.__)("Hosted on this site (same-origin, permanent).","spreadsheetconverter"):(0,n.__)("Linked to the SpreadsheetConverter cloud.","spreadsheetconverter")}),"selfhost"===r&&(0,p.jsx)("p",{children:(0,p.jsx)(l.ExternalLink,{href:`${f}/index.html`,children:(0,n.__)("Open the standalone test page","spreadsheetconverter")})}),(0,p.jsx)(l.Button,{variant:"secondary",onClick:()=>{t({mode:"",src:"",name:"",token:""}),b(""),C(null)},children:(0,n.__)("Replace calculator…","spreadsheetconverter")})]})}),(0,p.jsx)(m,{base:f,name:w})]}):(0,p.jsx)("div",{..._,children:(0,p.jsx)(l.Placeholder,{icon:"calculator",label:(0,n.__)("SpreadsheetConverter Calculator","spreadsheetconverter"),instructions:(0,n.__)("Paste the link you copied from the SpreadsheetConverter task pane in Excel (Copy link after Convert, or Copy permanent link after Publish to Cloud).","spreadsheetconverter"),children:(0,p.jsxs)("div",{style:{width:"100%"},children:[(0,p.jsx)(l.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,n.__)("Calculator link","spreadsheetconverter"),hideLabelFromVision:!0,placeholder:(0,n.__)("Paste calculator link…","spreadsheetconverter"),value:k,onChange:e=>{b(e),C(null)},disabled:g}),""!==k.trim()&&S.message&&(0,p.jsx)(l.Notice,{status:"warning",isDismissible:!1,children:S.message}),j&&(0,p.jsx)(l.Notice,{status:"error",isDismissible:!1,children:j}),"selfhost"===S.action&&(0,p.jsx)(l.Button,{variant:"primary",onClick:()=>{x(!0),C(null),o()({path:"/ssc/v1/host-calculator",method:"POST",data:{url:k}}).then(e=>{x(!1),t({mode:"selfhost",src:e.url,name:e.name,token:k})}).catch(F)},disabled:g,children:(0,n.__)("Host on this site","spreadsheetconverter")}),"cloud"===S.action&&(0,p.jsx)(l.Button,{variant:"primary",onClick:()=>{x(!0),C(null),o()({path:"/ssc/v1/inspect-cloud",method:"POST",data:{url:k}}).then(e=>{x(!1),t({mode:"cloud",src:e.base,name:e.name,token:k})}).catch(F)},disabled:g,children:(0,n.__)("Link to the cloud","spreadsheetconverter")}),g&&(0,p.jsx)(l.Spinner,{}),(0,p.jsx)("div",{style:{marginTop:"8px"},children:(0,p.jsx)(l.FormFileUpload,{accept:".zip,application/zip",onChange:e=>{const n=e.target.files&&e.target.files[0];if(!n)return;x(!0),C(null);const s=new window.FormData;s.append("bundle",n),o()({path:"/ssc/v1/host-upload",method:"POST",body:s}).then(e=>{x(!1),t({mode:"selfhost",src:e.url,name:e.name,token:""})}).catch(F)},disabled:g,render:({openFileDialog:e})=>(0,p.jsx)(l.Button,{variant:"link",onClick:e,disabled:g,children:(0,n.__)("…or upload a downloaded calculator zip (offline fallback)","spreadsheetconverter")})})})]})})})},save:function(){return null}})})();1 (()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,r=window.wp.i18n,n=window.wp.element,s=window.wp.apiFetch;var o=e.n(s);const a=window.wp.blockEditor,c=window.wp.components,l=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,i=/^\/preview\/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})(?:\/|\.zip$|$)/,d=["localhost","127.0.0.1","[::1]","host.docker.internal"];function u(e,t){return e===t||e.endsWith("."+t)}function p(e,t={}){const r={kind:"unknown"};let n,s=(e||"").trim();if(""===s)return r;l.test(s)&&(s=`https://addin.spreadsheetconverter.com/preview/${s.toLowerCase()}/`);try{n=new URL(s)}catch(e){return r}const o=n.hostname.toLowerCase(),a=d.includes(o);if(a&&!t.allowLocalhost)return r;const c=n.protocol.replace(":","").toLowerCase();if("https"!==c&&(!a||"http"!==c))return r;const p=n.pathname||"/",m=`${c}://${o}${n.port?":"+n.port:""}`,f=u(o,"server.spreadsheetconverter.com");if(f||a){const e=function(e,t,r){const n=/^(\/t\/[^/]+)?\/forms\/([^/]+)(?:\/([^/]+))?\/?$/.exec(t);if(!n)return null;const s=n[1]||"",o=n[2],a=n[3]||"";let c="";if(""!==a&&"embed.html"!==a){if(["records","manifest","embed.css","calc.client.js","ssc.embed.js"].includes(a)||!/^\d+$/.test(a))return{kind:"server_notform"};c=a}const l=`${e}${s}/forms/${o}`;let i=r;return""!==c&&(i=`record=${encodeURIComponent(c)}${i?"&"+i:""}`),{kind:"server",base:l,name:decodeURIComponent(o),embed:`${l}/embed.html${i?"?"+i:""}`,page:l+(""!==c?"/"+c:""),script:`${l}/ssc.embed.js`}}(m,p,n.search.replace(/^\?/,""));if(e)return e;if(f)return{kind:"server_notform"}}if(a||u(o,"spreadsheetconverter.com")){const e=i.exec(p);return e?{kind:"conversion",host:m,uuid:e[1].toLowerCase()}:r}return u(o,"spreadsheethosting.com")?p.replace(/^\/+|\/+$/g,"").split("/").includes("tmp")?{kind:"cloud_test"}:{kind:"cloud_permanent",base:h(m,p)}:r}function h(e,t){const r=t.replace(/^\/+|\/+$/g,"").split("/").filter(Boolean);return r.length&&r[r.length-1].includes(".")&&r.pop(),r.length?`${e}/${r.join("/")}`:e}const m=window.ReactJSXRuntime;function f({base:e,name:t,script:r,embedSrc:s}){const o=(0,n.useRef)(null),a=r||`${e}/assets/js/ssc.embed.js`;return(0,n.useEffect)(()=>{const t=o.current;if(!t||!e)return;const r=t.ownerDocument,n=r.defaultView,s=n.customElements&&n.customElements.get("ssc-calc"),c=r.querySelector(`script[src="${a}"]`);if(!s&&!c){const e=r.createElement("script");e.src=a,r.body.appendChild(e)}},[e,a]),(0,m.jsx)("div",{ref:o,children:(0,m.jsx)("ssc-calc",{name:t,"data-src":s||`${e}/embed.html`})})}const v=JSON.parse('{"UU":"spreadsheetconverter/calculator"}');(0,t.registerBlockType)(v.UU,{edit:function({attributes:e,setAttributes:t}){const{mode:s,src:l,name:i,token:d}=e,u=(0,a.useBlockProps)(),[h,v]=(0,n.useState)(d||""),[_,w]=(0,n.useState)(!1),[b,k]=(0,n.useState)(null),x="undefined"!=typeof window&&window.sscembedSettings&&!!window.sscembedSettings.allowLocalhost,g=p(h,{allowLocalhost:x}),j=function(e){switch(e.kind){case"conversion":return{action:"selfhost",message:null};case"cloud_permanent":return{action:"cloud",message:null};case"server":return{action:"server",message:null};case"server_notform":return{action:null,message:(0,r.__)("Paste the form's own link — the address 'Open your form' opens in Excel (…/forms/your-form). Records lists, Properties pages and private links can't be embedded.","spreadsheetconverter")};case"cloud_test":return{action:null,message:(0,r.__)("This is a temporary test link — click Publish to Cloud in Excel for a permanent one.","spreadsheetconverter")};default:return{action:null,message:(0,r.__)("That doesn't look like a SpreadsheetConverter link — copy it again from the Excel panel.","spreadsheetconverter")}}}(g),C=e=>{w(!1),k(e&&e.message?e.message:(0,r.__)("The request failed — please try again.","spreadsheetconverter"))},$=()=>{t({mode:"",src:"",name:"",token:""}),v(""),k(null)};if(s&&l){const e="server"===s?p(d,{allowLocalhost:x}):null,t=(()=>{try{return new URL(l).hostname}catch(e){return l}})();let n=(0,r.__)("Linked to the SpreadsheetConverter cloud.","spreadsheetconverter");return"selfhost"===s?n=(0,r.__)("Hosted on this site (same-origin, permanent).","spreadsheetconverter"):"server"===s&&(n=`${(0,r.__)("Server form","spreadsheetconverter")} · ${i} · ${(0,r.__)("Embedded from","spreadsheetconverter")} ${t}`),(0,m.jsxs)("div",{...u,children:[(0,m.jsx)(a.InspectorControls,{children:(0,m.jsxs)(c.PanelBody,{title:(0,r.__)("Calculator","spreadsheetconverter"),children:[(0,m.jsx)("p",{children:n}),"selfhost"===s&&(0,m.jsx)("p",{children:(0,m.jsx)(c.ExternalLink,{href:`${l}/index.html`,children:(0,r.__)("Open the standalone test page","spreadsheetconverter")})}),(0,m.jsx)(c.Button,{variant:"secondary",onClick:$,children:(0,r.__)("Replace calculator…","spreadsheetconverter")})]})}),(0,m.jsx)(f,{base:l,name:i,script:e&&"server"===e.kind?e.script:void 0,embedSrc:e&&"server"===e.kind?e.embed:void 0})]})}return(0,m.jsx)("div",{...u,children:(0,m.jsx)(c.Placeholder,{icon:"calculator",label:(0,r.__)("SpreadsheetConverter Calculator","spreadsheetconverter"),instructions:(0,r.__)("Paste the link you copied from the SpreadsheetConverter task pane in Excel (Copy link after Publish to the Server, Copy link after Convert, or Copy permanent link after Publish to Cloud).","spreadsheetconverter"),children:(0,m.jsxs)("div",{style:{width:"100%"},children:[(0,m.jsx)(c.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,r.__)("Calculator link","spreadsheetconverter"),hideLabelFromVision:!0,placeholder:(0,r.__)("Paste calculator link…","spreadsheetconverter"),value:h,onChange:e=>{v(e),k(null)},disabled:_}),""!==h.trim()&&j.message&&(0,m.jsx)(c.Notice,{status:"warning",isDismissible:!1,children:j.message}),b&&(0,m.jsx)(c.Notice,{status:"error",isDismissible:!1,children:b}),"selfhost"===j.action&&(0,m.jsx)(c.Button,{variant:"primary",onClick:()=>{w(!0),k(null),o()({path:"/ssc/v1/host-calculator",method:"POST",data:{url:h}}).then(e=>{w(!1),t({mode:"selfhost",src:e.url,name:e.name,token:h})}).catch(C)},disabled:_,children:(0,r.__)("Host on this site","spreadsheetconverter")}),"cloud"===j.action&&(0,m.jsx)(c.Button,{variant:"primary",onClick:()=>{w(!0),k(null),o()({path:"/ssc/v1/inspect-cloud",method:"POST",data:{url:h}}).then(e=>{w(!1),t({mode:"cloud",src:e.base,name:e.name,token:h})}).catch(C)},disabled:_,children:(0,r.__)("Link to the cloud","spreadsheetconverter")}),"server"===j.action&&(0,m.jsx)(c.Button,{variant:"primary",onClick:()=>{t({mode:"server",src:g.base,name:g.name,token:h})},disabled:_,children:(0,r.__)("Embed from the Server","spreadsheetconverter")}),_&&(0,m.jsx)(c.Spinner,{}),(0,m.jsx)("div",{style:{marginTop:"8px"},children:(0,m.jsx)(c.FormFileUpload,{accept:".zip,application/zip",onChange:e=>{const r=e.target.files&&e.target.files[0];if(!r)return;w(!0),k(null);const n=new window.FormData;n.append("bundle",r),o()({path:"/ssc/v1/host-upload",method:"POST",body:n}).then(e=>{w(!1),t({mode:"selfhost",src:e.url,name:e.name,token:""})}).catch(C)},disabled:_,render:({openFileDialog:e})=>(0,m.jsx)(c.Button,{variant:"link",onClick:e,disabled:_,children:(0,r.__)("…or upload a downloaded calculator zip (offline fallback)","spreadsheetconverter")})})})]})})})},save:function(){return null}})})(); -
import-spreadsheets-from-microsoft-excel/trunk/build/render.php
r3587470 r3658269 24 24 25 25 // Not configured yet (no validated source) — render nothing on the page. 26 if ( '' === $sscembed_base || ! in_array( $sscembed_mode, array( 'selfhost', 'cloud' ), true ) ) {26 if ( '' === $sscembed_base || ! in_array( $sscembed_mode, array( 'selfhost', 'cloud', 'server' ), true ) ) { 27 27 return; 28 28 } 29 29 30 $sscembed_m = sscembed_render_mount( $sscembed_base, $sscembed_name ); 30 if ( 'server' === $sscembed_mode ) { 31 // sss8-form-embed-on-external-site step 1.5: re-classify the stored token 32 // server-side — the client's classification is never trusted. A tampered 33 // `src` riding a non-server token renders nothing. 34 $sscembed_c = sscembed_classify_url( 35 isset( $attributes['token'] ) ? (string) $attributes['token'] : '', 36 array( 37 'allow_localhost' => function_exists( 'sscembed_allow_localhost' ) && sscembed_allow_localhost(), 38 ) 39 ); 40 if ( 'server' !== $sscembed_c['kind'] ) { 41 return; 42 } 43 $sscembed_m = sscembed_render_mount( 44 $sscembed_c['base'], 45 '' !== $sscembed_name ? $sscembed_name : $sscembed_c['name'], 46 $sscembed_c['script'], 47 $sscembed_c['embed'] 48 ); 49 } else { 50 $sscembed_m = sscembed_render_mount( $sscembed_base, $sscembed_name ); 51 } 31 52 32 53 wp_enqueue_script( -
import-spreadsheets-from-microsoft-excel/trunk/import-spreadsheets-from-microsoft-excel.php
r3642160 r3658269 4 4 * Plugin URI: https://www.spreadsheetconverter.com/ 5 5 * Description: Embed live, calculating web pages converted from Excel by SpreadsheetConverter — inline in your theme, no iframe. 6 * Version: 12. 0.26 * Version: 12.1.0 7 7 * Requires at least: 6.5 8 8 * Requires PHP: 7.4 … … 18 18 defined( 'ABSPATH' ) || exit; 19 19 20 define( 'SSCEMBED_VERSION', '12. 0.2' );20 define( 'SSCEMBED_VERSION', '12.1.0' ); 21 21 define( 'SSCEMBED_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 22 22 define( 'SSCEMBED_PLUGIN_FILE', __FILE__ ); -
import-spreadsheets-from-microsoft-excel/trunk/includes/render-mount.php
r3587470 r3658269 22 22 * Build the two-line mount for a hosted bundle base URL. 23 23 * 24 * @param string $base Directory base URL (same-origin uploads dir for 25 * self-host, cloud directory for cloud-link). 26 * @param string $name Workbook name, opaque. 24 * @param string $base Directory base URL (same-origin uploads dir 25 * for self-host, cloud directory for 26 * cloud-link, form base for a Server form). 27 * @param string $name Workbook name, opaque. 28 * @param string|null $script_url Bootstrap URL override. The Server serves 29 * ssc.embed.js as a SIBLING of embed.html 30 * (<base>/ssc.embed.js); default keeps the 31 * classic bundle layout (assets/js/…). 32 * @param string|null $data_src Mount data-src override — a Server record 33 * link mounts <base>/embed.html?record=<id>. 34 * Default keeps <base>/embed.html. 27 35 * @return array { 28 36 * @type string $mount The <ssc-calc> element line. … … 32 40 * } 33 41 */ 34 function sscembed_render_mount( $base, $name ) {42 function sscembed_render_mount( $base, $name, $script_url = null, $data_src = null ) { 35 43 $base = untrailingslashit( trim( (string) $base ) ); 36 44 37 45 $mount = '<ssc-calc name="' . esc_attr( $name ) . '" data-src="' 38 . esc_url( $base . '/embed.html' ) . '"></ssc-calc>';46 . esc_url( null !== $data_src ? $data_src : $base . '/embed.html' ) . '"></ssc-calc>'; 39 47 40 48 return array( 41 49 'mount' => $mount, 42 'script_url' => $base . '/assets/js/ssc.embed.js',50 'script_url' => null !== $script_url ? $script_url : $base . '/assets/js/ssc.embed.js', 43 51 ); 44 52 } -
import-spreadsheets-from-microsoft-excel/trunk/includes/shortcode.php
r3587470 r3658269 13 13 * the block or REST) -> same-origin mount; 14 14 * * permanent cloud URL -> cloud mount; 15 * * Server form link -> Server mount (bootstrap is 16 * the embed.html sibling; record links carry 17 * ?record on the data-src); 15 18 * * anything else (incl. /tmp/ test links, garbage, 16 * never-hosted conversions ) -> no mount, an HTML17 * comment explains why (explicit, no silent18 * coercion).19 * never-hosted conversions, non-form Server 20 * links) -> no mount, an HTML comment explains 21 * why (explicit, no silent coercion). 19 22 * 20 23 * @package SpreadsheetConverter … … 40 43 ); 41 44 42 $base = ''; 43 $name = (string) $atts['name']; 45 $base = ''; 46 $name = (string) $atts['name']; 47 $script_url = null; 48 $data_src = null; 44 49 45 50 if ( '' !== $atts['src'] ) { … … 67 72 } elseif ( 'cloud_permanent' === $classified['kind'] ) { 68 73 $base = $classified['base']; 74 } elseif ( 'server' === $classified['kind'] ) { 75 // sss8-form-embed-on-external-site step 1.5: the Server form 76 // mounts straight off the Server — sibling bootstrap, and a 77 // record link's ?record query rides the data-src. 78 $base = $classified['base']; 79 $script_url = $classified['script']; 80 $data_src = $classified['embed']; 81 if ( '' === $name ) { 82 $name = $classified['name']; 83 } 84 } elseif ( 'server_notform' === $classified['kind'] ) { 85 return "\n<!-- ssc_calc: paste the form's own link (.../forms/your-form) - Records lists, Properties pages and private links can't be embedded. -->\n"; 69 86 } elseif ( 'cloud_test' === $classified['kind'] ) { 70 87 return "\n<!-- ssc_calc: temporary Test-in-Cloud links cannot be embedded - use Publish to Cloud in Excel for a permanent one. -->\n"; … … 78 95 } 79 96 80 $mount = sscembed_render_mount( $base, $name );97 $mount = sscembed_render_mount( $base, $name, $script_url, $data_src ); 81 98 82 99 wp_enqueue_script( -
import-spreadsheets-from-microsoft-excel/trunk/includes/token.php
r3587470 r3658269 9 9 * classify as `unknown` and never be fetched. 10 10 * 11 * Kinds (explicit 4-way return, no default-swallow):11 * Kinds (explicit 6-way return, no default-swallow): 12 12 * conversion — allow-listed convert host + /preview/<uuid>/ path 13 13 * (the short-lived preview link Convert produces) … … 16 16 * cloud_permanent — *.spreadsheethosting.com without /tmp/ (Publish to 17 17 * Cloud, keepdays=-1) 18 * server — server.spreadsheetconverter.com form link 19 * ([/t/<slug>]/forms/<name>[/<record>|/embed.html]) — 20 * mounted straight off the Server, nothing fetched 21 * server_notform — a Server link that is not a form's own address 22 * (records list, Properties page, capability link, …) 18 23 * unknown — anything else, including any off-allow-list host 19 24 * … … 115 120 $origin = $scheme . '://' . $host . ( isset( $parts['port'] ) ? ':' . $parts['port'] : '' ); 116 121 122 // --- Server form: server.spreadsheetconverter.com (sss8) -------------- 123 // MUST sit ABOVE the conversion branch: the server host also matches 124 // 'spreadsheetconverter.com' and would fall to `unknown` there. The 125 // localhost dev opt-in reaches a dev Server the same way it reaches a 126 // dev convert host — by path shape. 127 $is_server_host = sscembed_host_matches( $host, 'server.spreadsheetconverter.com' ); 128 if ( $is_server_host || $is_localhost ) { 129 $server = sscembed_classify_server_path( 130 $origin, 131 $path, 132 isset( $parts['query'] ) ? $parts['query'] : '' 133 ); 134 if ( null !== $server ) { 135 return $server; 136 } 137 if ( $is_server_host ) { 138 // A Server link that is not a form — records list, Properties 139 // page, capability link, space root. Corrective message, never 140 // a silent fall-through to `unknown`. 141 return array( 'kind' => 'server_notform' ); 142 } 143 } 144 117 145 // --- conversion: allow-listed convert host + /preview/<uuid>/ --------- 118 146 if ( $is_localhost || sscembed_host_matches( $host, 'spreadsheetconverter.com' ) ) { … … 143 171 144 172 /** 173 * Classify a path on the Server host against sss8's route grammar: 174 * [/t/<slug>]/forms/<name>[/<last>], apex or tenant-prefixed. 175 * 176 * <last> may be a record id (digits — carried onto the embed URL as 177 * ?record=<id>), the embed.html address itself, or a reserved sibling 178 * (records list, Properties manifest, the bundle assets) which is NOT a 179 * form. The pasted query string (?view=1) passes through to the embed URL. 180 * The name is URL-decoded for display, never re-slugged. 181 * 182 * @param string $origin scheme://host[:port]. 183 * @param string $path URL path. 184 * @param string $query Raw query string (may be ''). 185 * @return array|null server / server_notform classification, or null when 186 * the path is not under /forms/ at all. 187 */ 188 function sscembed_classify_server_path( $origin, $path, $query ) { 189 if ( ! preg_match( '#^(/t/[^/]+)?/forms/([^/]+)(?:/([^/]+))?/?$#', $path, $m ) ) { 190 return null; 191 } 192 $prefix = isset( $m[1] ) ? $m[1] : ''; 193 $name = $m[2]; 194 $last = isset( $m[3] ) ? $m[3] : ''; 195 196 $record = ''; 197 if ( '' !== $last && 'embed.html' !== $last ) { 198 $reserved = array( 'records', 'manifest', 'embed.css', 'calc.client.js', 'ssc.embed.js' ); 199 if ( in_array( $last, $reserved, true ) || ! preg_match( '/^\d+$/', $last ) ) { 200 return array( 'kind' => 'server_notform' ); 201 } 202 $record = $last; 203 } 204 205 $base = $origin . $prefix . '/forms/' . $name; 206 $qs = $query; 207 if ( '' !== $record ) { 208 $qs = 'record=' . rawurlencode( $record ) . ( '' !== $qs ? '&' . $qs : '' ); 209 } 210 211 return array( 212 'kind' => 'server', 213 'base' => $base, 214 'name' => rawurldecode( $name ), 215 'embed' => $base . '/embed.html' . ( '' !== $qs ? '?' . $qs : '' ), 216 'page' => $base . ( '' !== $record ? '/' . $record : '' ), 217 'script' => $base . '/ssc.embed.js', 218 ); 219 } 220 221 /** 145 222 * Directory base of a pasted cloud URL: drop a trailing file segment (one 146 223 * containing a dot), keep directory segments, no trailing slash. -
import-spreadsheets-from-microsoft-excel/trunk/readme.txt
r3642160 r3658269 3 3 Tags: calculator, excel, spreadsheet, form, embed 4 4 Requires at least: 6.5 5 Tested up to: 7. 05 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 12. 0.27 Stable tag: 12.1.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 24 24 https://addin.spreadsheetconverter.com/install 25 25 26 **Two hosting modes:** 27 28 * **Host on this site (recommended)** — paste the conversion link copied 29 from the SpreadsheetConverter task pane in Excel and click *Host on this 26 **Three hosting modes:** 27 28 * **Server form (recommended)** — click *Publish to the Server* in Excel 29 (SpreadsheetConverter Server), then *Copy link*, and paste it. The form 30 mounts inline on your page straight from the Server — calculating live, 31 **saving what visitors type as records on the Server**, no Server menus, 32 no iframe. Any conversion flavor works; you do not need the Embeddable 33 option for this mode. 34 * **Host on this site** — paste the conversion link copied from the 35 SpreadsheetConverter task pane in Excel and click *Host on this 30 36 site*. WordPress fetches the calculator from the SpreadsheetConverter 31 37 cloud and stores it inside your own site … … 47 53 == External services == 48 54 49 This plugin connects to the SpreadsheetConverter cloud in twosituations,50 both initiated explicitly by an editor — never on a public page view in55 This plugin connects to SpreadsheetConverter services in three situations, 56 each initiated explicitly by an editor — never on a public page view in 51 57 self-host mode: 52 58 … … 60 66 configuring the block, the WordPress server fetches the published 61 67 calculator's index page once to read its name. 68 3. **Server form** — the page embeds the form directly from 69 SpreadsheetConverter Server (`server.spreadsheetconverter.com`); 70 visitors' browsers request the form and its assets from that host, and 71 what a visitor types into the form is saved as a record on the Server 72 (that is the product: a saving form). Nothing is fetched by your 73 WordPress server in this mode. 62 74 63 75 Both services are provided by Framtidsforum I&M AB (SpreadsheetConverter). … … 78 90 SpreadsheetConverter). 79 91 3. **Sign in** if prompted (required to convert). 80 4. **Select Flavor = HTML and tick the Embeddable checkbox, then press 81 Convert.** The **Embeddable** option is required — it produces the inline 82 bundle the block embeds without an iframe; a non-embeddable conversion (or 83 another flavor) will not work in the block. The spreadsheet becomes an 84 interactive web calculator (a few seconds) and a preview opens 85 automatically in a new browser tab. 86 5. **Get the link to paste into WordPress.** On the green **Converted** card, 87 open **▸ More options**: 88 * To host it on your own WordPress site (recommended): under **WordPress**, 89 press **Copy link** — the short-lived conversion link (use it within a 90 few minutes). 92 4. **Press Convert.** For the recommended Server mode any flavor is fine — 93 the Server compiles the workbook itself. For *Host on this site* or 94 *Link to the cloud* you must select **Flavor = HTML and tick the 95 Embeddable checkbox** first — those two modes embed the converted bundle, 96 and only an Embeddable HTML conversion produces it. The spreadsheet 97 becomes an interactive web calculator (a few seconds). 98 5. **Get the link to paste into WordPress.** On the green **Converted** card: 99 * *Recommended:* press **Publish to the Server**, then **Copy link** on 100 the *Published to the Server* card — a permanent link to your form on 101 SpreadsheetConverter Server (visitors' entries are saved as records 102 there). 103 * To host it on your own WordPress site: under **▸ More options → 104 WordPress**, press **Copy link** — the short-lived conversion link (use 105 it within a few minutes). 91 106 * To link to the SpreadsheetConverter cloud instead: under **Classic 92 107 cloud**, press **Publish to cloud**, then copy the permanent link. Only a … … 94 109 "Test in cloud" link (its address contains `/tmp/`) is rejected by the 95 110 block. 96 * In both casesyou paste the **whole link** and the block double-checks111 * In every case you paste the **whole link** and the block double-checks 97 112 it. Nothing is downloaded to your computer. 98 * Not for WordPress: a **Publish to Server** link (address on99 `server.spreadsheetconverter.com`) — the block accepts only the two100 links above.101 113 102 114 = Part 2 — Add it to your WordPress page = … … 109 121 8. **Paste your link.** The block recognizes the link type and offers the 110 122 matching option: 111 * Conversion link → **Host on this site** (recommended). Click it. 123 * Server form link (`…/forms/your-form`, a record link 124 `…/forms/your-form/17`, or the `…/embed.html` address itself) → 125 **Embed from the Server** (recommended). Click it. The form mounts 126 inline straight from the Server — no Server header, menu or records 127 row, just the form, styled by your theme. 128 * Conversion link → **Host on this site**. Click it. 112 129 WordPress fetches your calculator and stores it inside your own site. 113 130 * Publish-to-Cloud link → **Link to the cloud.** The calculator stays … … 116 133 temporary test link — click Publish to Cloud in Excel for a permanent 117 134 one."* 135 * A Server link that is not a form (a Records list, a Properties page, 136 a private link) → *"Paste the form's own link — the address 'Open 137 your form' opens in Excel (…/forms/your-form). Records lists, 138 Properties pages and private links can't be embedded."* 118 139 * Anything unrecognized → *"That doesn't look like a 119 140 SpreadsheetConverter link — copy it again from the Excel panel."* … … 122 143 10. **Press Publish** (the WordPress button). The page goes live. 123 144 11. **View your live page.** It calculates, validates, moves between 124 sheets, and Submit works. 145 sheets, and Submit works. On a Server form, what a visitor types is 146 saved to the Server exactly as on the Server's own page: a small save 147 status sits at the top of the form, action buttons show their outcome 148 in the page, and you find the records under **Records** on the Server. 149 150 = Server forms — notes and limits = 151 152 * **One calculator per page** (all modes; the calculator is page-global). 153 * **Classic themes:** 154 `[ssc_calc token="https://server.spreadsheetconverter.com/t/acme/forms/order"]`. 155 * **Updating later:** re-publish to the Server — your page mounts the new 156 version on reload; nothing to change in WordPress. 157 * **Returning visitors:** in most browsers a visitor who comes back to your 158 page is recognized again (the Server keeps their identity in a partitioned 159 cookie) and continues with their earlier entry. A browser that refuses 160 partitioned cookies starts a fresh entry instead — the earlier one stays 161 safe on the Server. 162 * **No sign-in inside the mount:** a members-only form shows the Server's 163 refusal in the save status with a link to sign in on the Server's own 164 page. 165 * **Forms published before this release:** re-publish once so images inside 166 the form and returning-visitor recognition work in the mount (both ride a 167 per-form file that updates on publish). 168 * **Your site sends its own Content-Security-Policy?** Allow 169 `https://server.spreadsheetconverter.com` in `script-src`, `style-src`, 170 `img-src` and `connect-src` — the same four the cloud-link mode needs for 171 spreadsheethosting. WordPress itself sends no CSP by default. 172 * **Troubleshooting:** open `…/forms/your-form/embed.html` directly in a 173 browser. If it works there but not on your page, the issue is your page's 174 CSP, a plugin stripping the custom element, or a theme script clashing 175 with a global the calculator uses. 125 176 126 177 == Screenshots == … … 145 196 = My theme uses the classic editor — can I still embed? = 146 197 147 Yes: `[ssc_calc token="…"]` (a link you pasted/hosted via the block or a 148 permanent cloud link) or `[ssc_calc src="…"]` (the calculator's base URL). 198 Yes: `[ssc_calc token="…"]` (a link you pasted/hosted via the block, a 199 permanent cloud link, or a Server form link) or `[ssc_calc src="…"]` (the 200 calculator's base URL). 201 202 = What is the difference between a Server form and the other modes? = 203 204 A Server form is hosted on SpreadsheetConverter Server and **saves what 205 visitors type as records** you can review there — it is a form, not just a 206 calculator. The other two modes embed a static calculating page (self-hosted 207 or on the cloud); nothing is stored unless the workbook has its own Submit. 208 For other websites (Squarespace, Wix, plain HTML) the form's Properties page 209 on the Server shows the same two-line embed code to copy. 149 210 150 211 = How do I update the calculator later? = … … 177 238 178 239 == Changelog == 240 241 = 12.1.0 = 242 * New: **Server form** mode — paste a SpreadsheetConverter Server form link 243 (`…/forms/your-form`) and press *Embed from the Server*. The form mounts 244 inline in your theme (no iframe, no Server menus), calculates live, and 245 saves visitors' entries as records on the Server. Record links and 246 `?view=1` links work too. 247 * The `[ssc_calc]` shortcode accepts Server form links. 248 * Images and other assets inside an embedded calculator now load from the 249 calculator's own host in every mode (previously they could wrongly be 250 requested from your page's address). 251 * Clearer message when a pasted Server link is not a form's own address 252 (a Records list, a Properties page, a private link). 179 253 180 254 = 12.0.2 = … … 203 277 == Upgrade Notice == 204 278 279 = 12.1.0 = 280 New Server form mode: paste a Publish-to-Server link and embed a saving form 281 inline on your page. Existing embeds are untouched. 282 205 283 = 12.0.2 = 206 284 Minor editor polish: clearer placeholder in the block's link field.
Note:
See TracChangeset
for help on using the changeset viewer.