2.0.5 • Published 13 days ago

@onereach/ssml-editor v2.0.5

Weekly downloads
1,062
License
UNLICENSED
Repository
-
Last release
13 days ago

ssml-app

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Run watcher

npm run watch

Customize configuration

See Configuration Reference.

To see the project in Action Desk

  1. run the local server on any port (in this example it's 5500)
  2. Create an empty View in Action Desk and paste the next code to the its 'Details' section:

Template:

<ssml :vm="vm"></ssml>

Code:

function getScript(url) {
  return new Promise((resolve, reject) => {
    var xhr = new XMLHttpRequest();

    xhr.open("get", url);

    xhr.onload = function() {
      if (this.status >= 200 && this.status < 300) {
        resolve(xhr.response);
      } else {
        reject({
          status     : this.status,
          statusText : xhr.statusText,
        });
      }
    };

    xhr.onerror = function() {
      reject({
        status     : this.status,
        statusText : xhr.statusText,
      });
    };

    xhr.send();
  });
};

function loadScript(url) {
  return new Promise((resolve, reject) => {
    let script     = document.createElement('script');

    script.src     = url;
    script.async   = true;
    script.onload  = resolve;
    script.onerror = reject;

    document.body.appendChild(script);
  });
}

function loadComponent(url, name, dev) {
  return async () => {
    try {
      if (!dev) {
        let scope  = {};
        let data   = await getScript(url);
        
        window.Vue = Vue;
        (new Function("Vue", `let vue = Vue;let self = this;${data}`)).bind(scope, Vue)();
        delete window.Vue;
        
        return (name) ? scope[name] : scope;
      } else {
        window.Vue = Vue;
        await loadScript(url);
        delete window.Vue;
        
        return window[name];
      }
    } catch(e) {
      console.error(e);
    }
  }
}
return {
  data() {
    return {
      vm : Vue
    }
  },

  components: {
    ssml : loadComponent('http://127.0.0.1:5500/dist/ssml.umd.js',"ssml", true)
  }
};
2.0.5

13 days ago

2.0.3

6 months ago

2.0.4

6 months ago

2.0.2

11 months ago

2.0.1

11 months ago

2.0.0

12 months ago

1.2.0

1 year ago

1.1.29

1 year ago

1.1.28

1 year ago

1.1.30

1 year ago

1.1.25-0

2 years ago

1.1.27

2 years ago

1.1.26

2 years ago

1.1.25

2 years ago

1.1.23

3 years ago

1.1.24

3 years ago

1.1.22

3 years ago

1.1.21

4 years ago

1.1.20

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.17

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.158

4 years ago

1.0.157

4 years ago

1.0.159

4 years ago

1.0.156

4 years ago

1.0.154

4 years ago

1.0.155

4 years ago

1.0.153

4 years ago

1.0.149

4 years ago

1.0.148

4 years ago

1.0.150

4 years ago

1.0.152

4 years ago

1.0.151

4 years ago

1.0.147

4 years ago

1.0.146

4 years ago

1.0.145

4 years ago

1.0.144

4 years ago

1.0.143

4 years ago

1.0.142

4 years ago

1.0.141

4 years ago

1.0.140

4 years ago

1.0.139

4 years ago

1.0.138

4 years ago

1.0.136

4 years ago

1.0.137

4 years ago

1.0.134

4 years ago

1.0.135

4 years ago

1.0.133

4 years ago

1.0.131

4 years ago

1.0.130

4 years ago

1.0.129

4 years ago

1.0.128

4 years ago

1.0.125

4 years ago

1.0.127

4 years ago

1.0.126

4 years ago

1.0.124

4 years ago

1.0.123

4 years ago

1.0.122

4 years ago

1.0.121

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago