Plugin Directory

Changeset 3352490


Ignore:
Timestamp:
08/29/2025 09:06:15 AM (7 months ago)
Author:
holdbar
Message:

Update to version 1.5.1 from GitHub

Location:
understory
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • understory/tags/1.5.1/CLAUDE.md

    r3351241 r3352490  
    185185### Version Management
    186186
    187 Current version: 1.5.0 (defined in both `package.json` and `understory.php`)
     187Current version: 1.5.1 (defined in both `package.json` and `understory.php`)
  • understory/tags/1.5.1/assets/js/gutenberg-gift-card-block-editor.js

    r3351241 r3352490  
    3232        type: "string",
    3333        default: "en",
     34      },
     35      variant: {
     36        type: "string",
     37        default: "default",
    3438      },
    3539      companyId: {
     
    123127              options: languages,
    124128              onChange: (newVal) => setAttributes({ language: newVal }),
     129            }),
     130
     131            el(SelectControl, {
     132              label: "Widget Variant",
     133              value: attributes.variant,
     134              options: [
     135                {
     136                  label: "Default (with experience selection)",
     137                  value: "default",
     138                },
     139                { label: "Amount only (simplified)", value: "amount" },
     140              ],
     141              onChange: (newVal) => setAttributes({ variant: newVal }),
     142              help: "Choose the widget variant. 'Amount only' hides the experience selection dropdown and shows only the amount and message fields.",
    125143            })
    126144          )
     
    134152            "data-storefront-id": attributes.storefrontId,
    135153            "data-language": attributes.language,
     154            "data-variant": attributes.variant,
    136155          })
    137156        )
  • understory/tags/1.5.1/assets/js/gutenberg-gift-card-block-editor.min.js

    r3351241 r3352490  
    1 var UNDERSTORY_GIFT_CARD_WIDGET_SCRIPT="https://widgets.understory.io/widgets/understory-gift-card-widget.js?environment=production";!function(t,e,n,a,o){var r=e.createElement,d=t.registerBlockType,{SelectControl:i,PanelBody:s}=n,g=o.InspectorControls,l=e.useEffect,c=e.useState;d("understory/gift-card-widget",{title:"Understory Gift Card Widget",icon:"store",category:"widgets",attributes:{storefrontId:{type:"string",default:""},language:{type:"string",default:"en"},companyId:{type:"string"}},edit:function({attributes:t,setAttributes:e}){var[o,d]=c([]),[u,p]=c([]),[f,w]=c(!0);return l(()=>{!function(){const{companyId:n,storefronts:o,languages:r}=a;e({companyId:n});const i=[...Object.entries(o).map(([t,e])=>({label:e,value:t}))];d(i);const s=[...Object.entries(r).map(([t,e])=>({label:e,value:t}))];p(s);const g={};t.storefrontId||(g.storefrontId=i[0]?.value||"");t.language&&""!==t.language||(g.language=s[0]?.value||"en");Object.keys(g).length>0&&e(g);w(!1),function(t,e){if(!document.getElementById(e)){var n=document.createElement("script");n.id=e,n.src=t,n.async=!0,document.body.appendChild(n)}}(UNDERSTORY_GIFT_CARD_WIDGET_SCRIPT,"understory-gift-card-widget")}()},[]),f?r(n.Spinner):r("div",{},r(g,{},r(s,{title:"Settings",initialOpen:!0},r(i,{label:"Storefront",value:t.storefrontId,options:o,onChange:t=>{e({storefrontId:t})}}),r(i,{label:"Language",value:t.language,options:u,onChange:t=>e({language:t})}))),r("div",{className:"understory-widget-preview"},r("div",{className:"understory-gift-card-widget","data-company-id":t.companyId,"data-storefront-id":t.storefrontId,"data-language":t.language})))},save:function(){}})}(window.wp.blocks,window.wp.element,window.wp.components,window.understoryGiftCardData,window.wp.blockEditor);
     1var UNDERSTORY_GIFT_CARD_WIDGET_SCRIPT="https://widgets.understory.io/widgets/understory-gift-card-widget.js?environment=production";!function(e,t,n,a,o){var r=t.createElement,i=e.registerBlockType,{SelectControl:d,PanelBody:s}=n,l=o.InspectorControls,u=t.useEffect,g=t.useState;i("understory/gift-card-widget",{title:"Understory Gift Card Widget",icon:"store",category:"widgets",attributes:{storefrontId:{type:"string",default:""},language:{type:"string",default:"en"},variant:{type:"string",default:"default"},companyId:{type:"string"}},edit:function({attributes:e,setAttributes:t}){var[o,i]=g([]),[c,p]=g([]),[f,w]=g(!0);return u(()=>{!function(){const{companyId:n,storefronts:o,languages:r}=a;t({companyId:n});const d=[...Object.entries(o).map(([e,t])=>({label:t,value:e}))];i(d);const s=[...Object.entries(r).map(([e,t])=>({label:t,value:e}))];p(s);const l={};e.storefrontId||(l.storefrontId=d[0]?.value||"");e.language&&""!==e.language||(l.language=s[0]?.value||"en");Object.keys(l).length>0&&t(l);w(!1),function(e,t){if(!document.getElementById(t)){var n=document.createElement("script");n.id=t,n.src=e,n.async=!0,document.body.appendChild(n)}}(UNDERSTORY_GIFT_CARD_WIDGET_SCRIPT,"understory-gift-card-widget")}()},[]),f?r(n.Spinner):r("div",{},r(l,{},r(s,{title:"Settings",initialOpen:!0},r(d,{label:"Storefront",value:e.storefrontId,options:o,onChange:e=>{t({storefrontId:e})}}),r(d,{label:"Language",value:e.language,options:c,onChange:e=>t({language:e})}),r(d,{label:"Widget Variant",value:e.variant,options:[{label:"Default (with experience selection)",value:"default"},{label:"Amount only (simplified)",value:"amount"}],onChange:e=>t({variant:e}),help:"Choose the widget variant. 'Amount only' hides the experience selection dropdown and shows only the amount and message fields."}))),r("div",{className:"understory-widget-preview"},r("div",{className:"understory-gift-card-widget","data-company-id":e.companyId,"data-storefront-id":e.storefrontId,"data-language":e.language,"data-variant":e.variant})))},save:function(){}})}(window.wp.blocks,window.wp.element,window.wp.components,window.understoryGiftCardData,window.wp.blockEditor);
  • understory/tags/1.5.1/includes/elementor/lib/class-gift-card-widget.php

    r3351241 r3352490  
    6969    );
    7070
     71    $this->add_control(
     72      'variant',
     73      [
     74        'label' => __('Variant', 'understory'),
     75        'type' => \Elementor\Controls_Manager::SELECT,
     76        'default' => 'default',
     77        'options' => [
     78          'default' => __('Default (with experience selection)', 'understory'),
     79          'amount' => __('Amount only (simplified)', 'understory'),
     80        ],
     81        'description' => __('Choose the widget variant. "Amount only" hides the experience selection dropdown and shows only the amount and message fields.', 'understory'),
     82      ]
     83    );
     84
    7185    $this->end_controls_section();
    7286  }
     
    100114      data-company-id="<?php echo esc_attr($company_id); ?>"
    101115      data-storefront-id="<?php echo esc_attr($storefront_id); ?>"
    102       data-language="<?php echo esc_attr($settings['language']); ?>"></div>
     116      data-language="<?php echo esc_attr($settings['language']); ?>"
     117      data-variant="<?php echo esc_attr($settings['variant'] ?? 'default'); ?>"></div>
    103118<?php
    104119  }
  • understory/tags/1.5.1/includes/gutenberg/class-gift-card-block.php

    r3351241 r3352490  
    6060        'companyId' => array('type' => 'string', 'default' => $company_id),
    6161        'storefrontId' => array('type' => 'string', 'default' => ''),
     62        'variant' => array('type' => 'string', 'default' => 'default'),
    6263        'apiBaseUrl' => UNDERSTORY_API_BASE_URL
    6364      )
     
    8788    }
    8889
     90    // Ensure variant is never empty - fallback to 'default' if not set
     91    $variant = $attributes['variant'] ?? 'default';
     92    if (empty($variant) || !in_array($variant, ['default', 'amount'])) {
     93      $variant = 'default';
     94    }
     95
    8996    // Enqueue the gift card widget script
    9097    wp_enqueue_script(
     
    101108      data-company-id="<?php echo esc_attr($company_id); ?>"
    102109      data-storefront-id="<?php echo esc_attr($storefront_id); ?>"
    103       data-language="<?php echo esc_attr($language); ?>"></div>
     110      data-language="<?php echo esc_attr($language); ?>"
     111      data-variant="<?php echo esc_attr($variant); ?>"></div>
    104112<?php
    105113    return ob_get_clean();
  • understory/tags/1.5.1/includes/shortcodes/class-gift-card-shortcode.php

    r3351241 r3352490  
    2929                'language' => 'en',
    3030                'storefront_id' => '',
     31                'variant' => 'default',
    3132            ),
    3233            $atts,
     
    5051        }
    5152
     53        // Validate variant attribute - fallback to 'default' if invalid
     54        $variant = $atts['variant'] ?? 'default';
     55        if (empty($variant) || !in_array($variant, array('default', 'amount'))) {
     56            $variant = 'default';
     57        }
     58
    5259        ob_start();
    5360?>
     
    5562            data-company-id="<?php echo esc_attr($atts['company_id']); ?>"
    5663            data-storefront-id="<?php echo esc_attr($storefront_id); ?>"
    57             data-language="<?php echo esc_attr($atts['language']); ?>"></div>
     64            data-language="<?php echo esc_attr($atts['language']); ?>"
     65            data-variant="<?php echo esc_attr($variant); ?>"></div>
    5866<?php
    5967        return ob_get_clean();
  • understory/tags/1.5.1/includes/tabs/tab-gift-card-widget-shortcode.php

    r3351241 r3352490  
    3232                </select>
    3333            </div>
     34            <div class="grid-container">
     35                <label for="gift-card-variant-select"><?php esc_html_e('Select widget variant', 'understory'); ?></label>
     36                <select id="gift-card-variant-select" data-shortcode-field="variant">
     37                    <option value="default" selected><?php esc_html_e('Default (with experience selection)', 'understory'); ?></option>
     38                    <option value="amount"><?php esc_html_e('Amount only (simplified)', 'understory'); ?></option>
     39                </select>
     40                <p class="description"><?php esc_html_e('Choose the widget variant. "Amount only" hides the experience selection dropdown and shows only the amount and message fields.', 'understory'); ?></p>
     41            </div>
    3442
    3543        </div>
  • understory/tags/1.5.1/package-lock.json

    r3351241 r3352490  
    11{
    22  "name": "understory",
    3   "version": "1.5.0",
     3  "version": "1.5.1",
    44  "lockfileVersion": 3,
    55  "requires": true,
     
    77    "": {
    88      "name": "understory",
    9       "version": "1.5.0",
     9      "version": "1.5.1",
    1010      "dependencies": {
    1111        "@mui/material": "6.4.2",
  • understory/tags/1.5.1/readme.txt

    r3351241 r3352490  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 1.5.0
     6Stable tag: 1.5.1
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    7878== Changelog ==
    7979
     80= 1.5.1 =
     81* The gift card widget now supports two variants: 1) Default with experience selection and 2) Only amount.
     82
    8083= 1.5.0 =
    8184* New gift card widget available in all editors and shortcodes. This allows you to present a gift-card only widget for purchasing experience or variable amount gift cards directly from your site..
  • understory/tags/1.5.1/understory.php

    r3351241 r3352490  
    33Plugin Name: Understory
    44Description: Connect your WordPress site with Understory, to easily add your booking widget to posts and pages.
    5 Version: 1.5.0
     5Version: 1.5.1
    66Author: Understory
    77Text Domain: understory
     
    1818define('UNDERSTORY_PLUGIN_URL', plugin_dir_url(__FILE__));
    1919define('UNDERSTORY_PLUGIN_SLUG', 'understory');
    20 define('UNDERSTORY_PLUGIN_VERSION', '1.5.0');
     20define('UNDERSTORY_PLUGIN_VERSION', '1.5.1');
    2121define('UNDERSTORY_OPTION_KEY', 'understory_options');
    2222define('UNDERSTORY_NONCE_KEY', 'understory_nonce');
  • understory/trunk/CLAUDE.md

    r3351241 r3352490  
    185185### Version Management
    186186
    187 Current version: 1.5.0 (defined in both `package.json` and `understory.php`)
     187Current version: 1.5.1 (defined in both `package.json` and `understory.php`)
  • understory/trunk/assets/js/gutenberg-gift-card-block-editor.js

    r3351241 r3352490  
    3232        type: "string",
    3333        default: "en",
     34      },
     35      variant: {
     36        type: "string",
     37        default: "default",
    3438      },
    3539      companyId: {
     
    123127              options: languages,
    124128              onChange: (newVal) => setAttributes({ language: newVal }),
     129            }),
     130
     131            el(SelectControl, {
     132              label: "Widget Variant",
     133              value: attributes.variant,
     134              options: [
     135                {
     136                  label: "Default (with experience selection)",
     137                  value: "default",
     138                },
     139                { label: "Amount only (simplified)", value: "amount" },
     140              ],
     141              onChange: (newVal) => setAttributes({ variant: newVal }),
     142              help: "Choose the widget variant. 'Amount only' hides the experience selection dropdown and shows only the amount and message fields.",
    125143            })
    126144          )
     
    134152            "data-storefront-id": attributes.storefrontId,
    135153            "data-language": attributes.language,
     154            "data-variant": attributes.variant,
    136155          })
    137156        )
  • understory/trunk/assets/js/gutenberg-gift-card-block-editor.min.js

    r3351241 r3352490  
    1 var UNDERSTORY_GIFT_CARD_WIDGET_SCRIPT="https://widgets.understory.io/widgets/understory-gift-card-widget.js?environment=production";!function(t,e,n,a,o){var r=e.createElement,d=t.registerBlockType,{SelectControl:i,PanelBody:s}=n,g=o.InspectorControls,l=e.useEffect,c=e.useState;d("understory/gift-card-widget",{title:"Understory Gift Card Widget",icon:"store",category:"widgets",attributes:{storefrontId:{type:"string",default:""},language:{type:"string",default:"en"},companyId:{type:"string"}},edit:function({attributes:t,setAttributes:e}){var[o,d]=c([]),[u,p]=c([]),[f,w]=c(!0);return l(()=>{!function(){const{companyId:n,storefronts:o,languages:r}=a;e({companyId:n});const i=[...Object.entries(o).map(([t,e])=>({label:e,value:t}))];d(i);const s=[...Object.entries(r).map(([t,e])=>({label:e,value:t}))];p(s);const g={};t.storefrontId||(g.storefrontId=i[0]?.value||"");t.language&&""!==t.language||(g.language=s[0]?.value||"en");Object.keys(g).length>0&&e(g);w(!1),function(t,e){if(!document.getElementById(e)){var n=document.createElement("script");n.id=e,n.src=t,n.async=!0,document.body.appendChild(n)}}(UNDERSTORY_GIFT_CARD_WIDGET_SCRIPT,"understory-gift-card-widget")}()},[]),f?r(n.Spinner):r("div",{},r(g,{},r(s,{title:"Settings",initialOpen:!0},r(i,{label:"Storefront",value:t.storefrontId,options:o,onChange:t=>{e({storefrontId:t})}}),r(i,{label:"Language",value:t.language,options:u,onChange:t=>e({language:t})}))),r("div",{className:"understory-widget-preview"},r("div",{className:"understory-gift-card-widget","data-company-id":t.companyId,"data-storefront-id":t.storefrontId,"data-language":t.language})))},save:function(){}})}(window.wp.blocks,window.wp.element,window.wp.components,window.understoryGiftCardData,window.wp.blockEditor);
     1var UNDERSTORY_GIFT_CARD_WIDGET_SCRIPT="https://widgets.understory.io/widgets/understory-gift-card-widget.js?environment=production";!function(e,t,n,a,o){var r=t.createElement,i=e.registerBlockType,{SelectControl:d,PanelBody:s}=n,l=o.InspectorControls,u=t.useEffect,g=t.useState;i("understory/gift-card-widget",{title:"Understory Gift Card Widget",icon:"store",category:"widgets",attributes:{storefrontId:{type:"string",default:""},language:{type:"string",default:"en"},variant:{type:"string",default:"default"},companyId:{type:"string"}},edit:function({attributes:e,setAttributes:t}){var[o,i]=g([]),[c,p]=g([]),[f,w]=g(!0);return u(()=>{!function(){const{companyId:n,storefronts:o,languages:r}=a;t({companyId:n});const d=[...Object.entries(o).map(([e,t])=>({label:t,value:e}))];i(d);const s=[...Object.entries(r).map(([e,t])=>({label:t,value:e}))];p(s);const l={};e.storefrontId||(l.storefrontId=d[0]?.value||"");e.language&&""!==e.language||(l.language=s[0]?.value||"en");Object.keys(l).length>0&&t(l);w(!1),function(e,t){if(!document.getElementById(t)){var n=document.createElement("script");n.id=t,n.src=e,n.async=!0,document.body.appendChild(n)}}(UNDERSTORY_GIFT_CARD_WIDGET_SCRIPT,"understory-gift-card-widget")}()},[]),f?r(n.Spinner):r("div",{},r(l,{},r(s,{title:"Settings",initialOpen:!0},r(d,{label:"Storefront",value:e.storefrontId,options:o,onChange:e=>{t({storefrontId:e})}}),r(d,{label:"Language",value:e.language,options:c,onChange:e=>t({language:e})}),r(d,{label:"Widget Variant",value:e.variant,options:[{label:"Default (with experience selection)",value:"default"},{label:"Amount only (simplified)",value:"amount"}],onChange:e=>t({variant:e}),help:"Choose the widget variant. 'Amount only' hides the experience selection dropdown and shows only the amount and message fields."}))),r("div",{className:"understory-widget-preview"},r("div",{className:"understory-gift-card-widget","data-company-id":e.companyId,"data-storefront-id":e.storefrontId,"data-language":e.language,"data-variant":e.variant})))},save:function(){}})}(window.wp.blocks,window.wp.element,window.wp.components,window.understoryGiftCardData,window.wp.blockEditor);
  • understory/trunk/includes/elementor/lib/class-gift-card-widget.php

    r3351241 r3352490  
    6969    );
    7070
     71    $this->add_control(
     72      'variant',
     73      [
     74        'label' => __('Variant', 'understory'),
     75        'type' => \Elementor\Controls_Manager::SELECT,
     76        'default' => 'default',
     77        'options' => [
     78          'default' => __('Default (with experience selection)', 'understory'),
     79          'amount' => __('Amount only (simplified)', 'understory'),
     80        ],
     81        'description' => __('Choose the widget variant. "Amount only" hides the experience selection dropdown and shows only the amount and message fields.', 'understory'),
     82      ]
     83    );
     84
    7185    $this->end_controls_section();
    7286  }
     
    100114      data-company-id="<?php echo esc_attr($company_id); ?>"
    101115      data-storefront-id="<?php echo esc_attr($storefront_id); ?>"
    102       data-language="<?php echo esc_attr($settings['language']); ?>"></div>
     116      data-language="<?php echo esc_attr($settings['language']); ?>"
     117      data-variant="<?php echo esc_attr($settings['variant'] ?? 'default'); ?>"></div>
    103118<?php
    104119  }
  • understory/trunk/includes/gutenberg/class-gift-card-block.php

    r3351241 r3352490  
    6060        'companyId' => array('type' => 'string', 'default' => $company_id),
    6161        'storefrontId' => array('type' => 'string', 'default' => ''),
     62        'variant' => array('type' => 'string', 'default' => 'default'),
    6263        'apiBaseUrl' => UNDERSTORY_API_BASE_URL
    6364      )
     
    8788    }
    8889
     90    // Ensure variant is never empty - fallback to 'default' if not set
     91    $variant = $attributes['variant'] ?? 'default';
     92    if (empty($variant) || !in_array($variant, ['default', 'amount'])) {
     93      $variant = 'default';
     94    }
     95
    8996    // Enqueue the gift card widget script
    9097    wp_enqueue_script(
     
    101108      data-company-id="<?php echo esc_attr($company_id); ?>"
    102109      data-storefront-id="<?php echo esc_attr($storefront_id); ?>"
    103       data-language="<?php echo esc_attr($language); ?>"></div>
     110      data-language="<?php echo esc_attr($language); ?>"
     111      data-variant="<?php echo esc_attr($variant); ?>"></div>
    104112<?php
    105113    return ob_get_clean();
  • understory/trunk/includes/shortcodes/class-gift-card-shortcode.php

    r3351241 r3352490  
    2929                'language' => 'en',
    3030                'storefront_id' => '',
     31                'variant' => 'default',
    3132            ),
    3233            $atts,
     
    5051        }
    5152
     53        // Validate variant attribute - fallback to 'default' if invalid
     54        $variant = $atts['variant'] ?? 'default';
     55        if (empty($variant) || !in_array($variant, array('default', 'amount'))) {
     56            $variant = 'default';
     57        }
     58
    5259        ob_start();
    5360?>
     
    5562            data-company-id="<?php echo esc_attr($atts['company_id']); ?>"
    5663            data-storefront-id="<?php echo esc_attr($storefront_id); ?>"
    57             data-language="<?php echo esc_attr($atts['language']); ?>"></div>
     64            data-language="<?php echo esc_attr($atts['language']); ?>"
     65            data-variant="<?php echo esc_attr($variant); ?>"></div>
    5866<?php
    5967        return ob_get_clean();
  • understory/trunk/includes/tabs/tab-gift-card-widget-shortcode.php

    r3351241 r3352490  
    3232                </select>
    3333            </div>
     34            <div class="grid-container">
     35                <label for="gift-card-variant-select"><?php esc_html_e('Select widget variant', 'understory'); ?></label>
     36                <select id="gift-card-variant-select" data-shortcode-field="variant">
     37                    <option value="default" selected><?php esc_html_e('Default (with experience selection)', 'understory'); ?></option>
     38                    <option value="amount"><?php esc_html_e('Amount only (simplified)', 'understory'); ?></option>
     39                </select>
     40                <p class="description"><?php esc_html_e('Choose the widget variant. "Amount only" hides the experience selection dropdown and shows only the amount and message fields.', 'understory'); ?></p>
     41            </div>
    3442
    3543        </div>
  • understory/trunk/package-lock.json

    r3351241 r3352490  
    11{
    22  "name": "understory",
    3   "version": "1.5.0",
     3  "version": "1.5.1",
    44  "lockfileVersion": 3,
    55  "requires": true,
     
    77    "": {
    88      "name": "understory",
    9       "version": "1.5.0",
     9      "version": "1.5.1",
    1010      "dependencies": {
    1111        "@mui/material": "6.4.2",
  • understory/trunk/readme.txt

    r3351241 r3352490  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 1.5.0
     6Stable tag: 1.5.1
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    7878== Changelog ==
    7979
     80= 1.5.1 =
     81* The gift card widget now supports two variants: 1) Default with experience selection and 2) Only amount.
     82
    8083= 1.5.0 =
    8184* New gift card widget available in all editors and shortcodes. This allows you to present a gift-card only widget for purchasing experience or variable amount gift cards directly from your site..
  • understory/trunk/understory.php

    r3351241 r3352490  
    33Plugin Name: Understory
    44Description: Connect your WordPress site with Understory, to easily add your booking widget to posts and pages.
    5 Version: 1.5.0
     5Version: 1.5.1
    66Author: Understory
    77Text Domain: understory
     
    1818define('UNDERSTORY_PLUGIN_URL', plugin_dir_url(__FILE__));
    1919define('UNDERSTORY_PLUGIN_SLUG', 'understory');
    20 define('UNDERSTORY_PLUGIN_VERSION', '1.5.0');
     20define('UNDERSTORY_PLUGIN_VERSION', '1.5.1');
    2121define('UNDERSTORY_OPTION_KEY', 'understory_options');
    2222define('UNDERSTORY_NONCE_KEY', 'understory_nonce');
Note: See TracChangeset for help on using the changeset viewer.