@dpgradio/creative 5.7.0 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.cjs CHANGED
@@ -4,9 +4,12 @@ module.exports = {
4
4
  es6: true,
5
5
  node: true,
6
6
  },
7
- extends: ['@dpgradio/eslint-config-recommended'],
7
+ extends: ['@dpgradio/eslint-config-recommended', 'plugin:import/recommended'],
8
8
  parserOptions: {
9
9
  sourceType: 'module',
10
10
  ecmaVersion: 2023,
11
11
  },
12
+ rules: {
13
+ 'import/extensions': [2, 'ignorePackages'],
14
+ },
12
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpgradio/creative",
3
- "version": "5.7.0",
3
+ "version": "5.8.1",
4
4
  "description": "Support package for standalone Javascript applications",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -30,6 +30,7 @@
30
30
  "devDependencies": {
31
31
  "@dpgradio/eslint-config-recommended": "^0.0.1",
32
32
  "eslint": "^8.32.0",
33
+ "eslint-plugin-import": "^2.27.5",
33
34
  "jest": "^29.4.0",
34
35
  "jest-environment-jsdom": "^29.4.0"
35
36
  }
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test, jest } from '@jest/globals'
2
- import hybrid from '../../app/hybrid'
3
- import openLink from '../../utils/openLink'
2
+ import hybrid from '../../app/hybrid.js'
3
+ import openLink from '../../utils/openLink.js'
4
4
 
5
5
  jest.mock('../../utils/hybrid.js', () => ({
6
6
  isNativeApp: jest.fn(),
package/src/index.js CHANGED
@@ -1,15 +1,15 @@
1
- export { default as hybrid } from './app/hybrid'
1
+ export { default as hybrid } from './app/hybrid.js'
2
2
 
3
- export { default as privacy } from './privacy/privacy'
4
- export { default as dataLayer } from './privacy/dataLayer'
3
+ export { default as privacy } from './privacy/privacy.js'
4
+ export { default as dataLayer } from './privacy/dataLayer.js'
5
5
 
6
- export { default as socket } from './socket/socket'
6
+ export { default as socket } from './socket/socket.js'
7
7
 
8
- export { default as configuration, config } from './config/config'
8
+ export { default as configuration, config } from './config/config.js'
9
9
 
10
- export { default as api } from './api/api'
10
+ export { default as api } from './api/api.js'
11
11
 
12
- export { default as loadScript } from './utils/loadScript'
13
- export { default as openLink } from './utils/openLink'
14
- export { default as tap } from './utils/tap'
15
- export { cdnImageUrl, cdnUrl } from './utils/cdnUrl'
12
+ export { default as loadScript } from './utils/loadScript.js'
13
+ export { default as openLink } from './utils/openLink.js'
14
+ export { default as tap } from './utils/tap.js'
15
+ export { cdnImageUrl, cdnUrl } from './utils/cdnUrl.js'
@@ -1,6 +1,6 @@
1
- import hybrid from '../app/hybrid'
2
- import { config } from '../config/config'
3
- import loadScript from '../utils/loadScript'
1
+ import hybrid from '../app/hybrid.js'
2
+ import { config } from '../config/config.js'
3
+ import loadScript from '../utils/loadScript.js'
4
4
 
5
5
  class DataLayer {
6
6
  constructor() {
@@ -1,5 +1,5 @@
1
- import { config } from '../config/config'
2
- import loadScript from '../utils/loadScript'
1
+ import { config } from '../config/config.js'
2
+ import loadScript from '../utils/loadScript.js'
3
3
 
4
4
  class Privacy {
5
5
  constructor() {
@@ -51,7 +51,7 @@ class Privacy {
51
51
 
52
52
  this.pushFunctional(() => {
53
53
  clearTimeout(timeout)
54
- this.consent = new Consent(window._privacy.consentString, window._privacy.purposesProvider.purposes)
54
+ this.consent = new Consent(window._privacy.consentString, window._privacy.purposesProvider.enabledPurposes)
55
55
  this.consentSubscribers.forEach((subscriber) => subscriber(this.consent))
56
56
  })
57
57
  }
@@ -1,4 +1,4 @@
1
- import openLink from '../utils/openLink'
1
+ import openLink from '../utils/openLink.js'
2
2
 
3
3
  export default class ShareResult {
4
4
  constructor(shareable, { url, image }) {
@@ -1,5 +1,6 @@
1
+ // eslint-disable-next-line import/no-unresolved -- TODO: Needs a rewrite to fetch
1
2
  import axios from 'axios'
2
- import ShareResult from './ShareResult'
3
+ import ShareResult from './ShareResult.js'
3
4
 
4
5
  export default class Shareable {
5
6
  constructor() {
package/src/share.js CHANGED
@@ -1,5 +1,5 @@
1
- import Shareable from './share/Shareable'
2
- import ImageGeneratorProperties from './share/ImageGeneratorProperties'
3
- import ShareResult from './share/ShareResult'
1
+ import Shareable from './share/Shareable.js'
2
+ import ImageGeneratorProperties from './share/ImageGeneratorProperties.js'
3
+ import ShareResult from './share/ShareResult.js'
4
4
 
5
5
  export { ShareResult, Shareable, ImageGeneratorProperties }
@@ -1,4 +1,4 @@
1
- import SockJS from 'sockjs-client/dist/sockjs'
1
+ import SockJS from 'sockjs-client/dist/sockjs.js'
2
2
 
3
3
  export default class SocketConnection {
4
4
  constructor(host, options) {
@@ -1,4 +1,4 @@
1
- import SocketSubscription from './SocketSubscription'
1
+ import SocketSubscription from './SocketSubscription.js'
2
2
 
3
3
  export default class SocketStation {
4
4
  constructor(connection, station) {
@@ -1,5 +1,5 @@
1
- import SocketConnection from './SocketConnection'
2
- import SocketStation from './SocketStation'
1
+ import SocketConnection from './SocketConnection.js'
2
+ import SocketStation from './SocketStation.js'
3
3
 
4
4
  // This is a JS rewrite of [https://github.com/medialaan/radio-sockets-server/blob/master/dist/q.coffee] with some minor additional functionality.
5
5
  class Socket {
@@ -1,4 +1,4 @@
1
- import hybrid from '../app/hybrid'
1
+ import hybrid from '../app/hybrid.js'
2
2
 
3
3
  export default function openLink(url) {
4
4
  const chromeAgent = navigator.userAgent.indexOf('Chrome') > -1