@icij/murmur-next 4.0.6 → 4.0.8

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.
Files changed (50) hide show
  1. package/dist/lib/components/AccordionStep.vue.d.ts +2 -1
  2. package/dist/lib/components/AccordionWrapper.vue.d.ts +2 -1
  3. package/dist/lib/components/AdvancedLinkForm.vue.d.ts +5 -4
  4. package/dist/lib/components/BrandExpansion.vue.d.ts +3 -2
  5. package/dist/lib/components/ConfirmButton.vue.d.ts +2 -1
  6. package/dist/lib/components/ContentPlaceholder.vue.d.ts +3 -2
  7. package/dist/lib/components/CustomPagination.vue.d.ts +6 -5
  8. package/dist/lib/components/DonateForm.vue.d.ts +5 -4
  9. package/dist/lib/components/EmbedForm.vue.d.ts +5 -4
  10. package/dist/lib/components/FollowUsPopover.vue.d.ts +5 -4
  11. package/dist/lib/components/GenericFooter.vue.d.ts +2 -1
  12. package/dist/lib/components/GenericHeader.vue.d.ts +232 -231
  13. package/dist/lib/components/HapticCopy.vue.d.ts +7 -5
  14. package/dist/lib/components/ImddbHeader.vue.d.ts +231 -230
  15. package/dist/lib/components/OrdinalLegend.vue.d.ts +2 -1
  16. package/dist/lib/components/RangePicker.vue.d.ts +3 -2
  17. package/dist/lib/components/ResponsiveIframe.vue.d.ts +4 -2
  18. package/dist/lib/components/ScaleLegend.vue.d.ts +1 -1
  19. package/dist/lib/components/SelectableDropdown.vue.d.ts +3 -2
  20. package/dist/lib/components/SharingOptions.vue.d.ts +2 -1
  21. package/dist/lib/components/SharingOptionsLink.vue.d.ts +2 -1
  22. package/dist/lib/components/SignUpForm.vue.d.ts +6 -5
  23. package/dist/lib/components/SlideUpDown.vue.d.ts +3 -2
  24. package/dist/lib/components/TexturedDeck.vue.d.ts +2 -1
  25. package/dist/lib/components/TinyPagination.vue.d.ts +9 -8
  26. package/dist/lib/composables/chart.d.ts +2 -1
  27. package/dist/lib/composables/resizeObserver.d.ts +2 -1
  28. package/dist/lib/composables/sendEmail.d.ts +2 -1
  29. package/dist/lib/config.d.ts +0 -1
  30. package/dist/lib/datavisualisations/ColumnChart.vue.d.ts +2 -1
  31. package/dist/lib/datavisualisations/LineChart.vue.d.ts +1 -1
  32. package/dist/lib/datavisualisations/StackedBarChart.vue.d.ts +1 -1
  33. package/dist/lib/datavisualisations/StackedColumnChart.vue.d.ts +1 -1
  34. package/dist/lib/i18n.d.ts +2 -2
  35. package/dist/lib/main.d.ts +11 -4
  36. package/dist/lib/maps/ChoroplethMap.vue.d.ts +2 -2
  37. package/dist/lib/maps/SymbolMap.vue.d.ts +2 -1
  38. package/dist/lib/murmur.css +1 -1
  39. package/dist/lib/murmur.js +15996 -17076
  40. package/dist/lib/murmur.js.map +1 -1
  41. package/dist/lib/murmur.umd.cjs +52 -60
  42. package/dist/lib/murmur.umd.cjs.map +1 -1
  43. package/dist/lib/types.d.ts +6 -3
  44. package/dist/lib/utils/assets.d.ts +1 -1
  45. package/dist/lib/utils/iframe-resizer.d.ts +1 -1
  46. package/dist/lib/utils/placeholder.d.ts +0 -1
  47. package/dist/lib/utils/placeholderTypes.d.ts +3 -2
  48. package/lib/i18n.ts +5 -4
  49. package/lib/main.ts +37 -12
  50. package/package.json +1 -1
@@ -1,7 +1,10 @@
1
- import { StyleValue, ComputedRef, Ref } from '../node_modules/vue';
1
+ /// <reference types="@/shims-vue" />
2
+ /// <reference types="node_modules/vue-i18n/dist/vue-i18n" />
3
+ import type { StyleValue } from '../node_modules/vue';
2
4
  import { AccordionKey, ParentKey } from './keys';
3
- import { GeoProjection } from 'd3-geo';
4
-
5
+ import { ComputedRef } from '../node_modules/vue';
6
+ import type { GeoProjection } from 'd3-geo';
7
+ import { Ref } from '../node_modules/vue';
5
8
  export type Step = symbol | string;
6
9
  export type Accordion = {
7
10
  emitAccordionNextStepEvent: () => void;
@@ -1,2 +1,2 @@
1
- export declare const injectAsset: ((file: string, id?: string) => Promise<unknown>) & import('lodash').MemoizedFunction;
1
+ export declare const injectAsset: ((file: string, id?: string) => Promise<unknown>) & import("lodash").MemoizedFunction;
2
2
  export declare const injectAssets: (...args: string[]) => Promise<void>;
@@ -1,5 +1,5 @@
1
+ /// <reference types="@/shims-pym" />
1
2
  import { Child as PymChild } from 'pym.js';
2
-
3
3
  export default class IframeResizer {
4
4
  initializer: Promise<PymChild>;
5
5
  constructor();
@@ -1,5 +1,4 @@
1
1
  import { BoxStyle, ContentPlaceholderStyledRows, ContentPlaceholderRows } from './placeholderTypes';
2
-
3
2
  export declare function isFlexBasis(value: string | number): boolean;
4
3
  export declare function isWidth(value: string | number): boolean;
5
4
  export declare function getBoxStyle(left: number, width: number, isLast: boolean, subClass?: string): BoxStyle[];
@@ -1,5 +1,6 @@
1
- import { StyleValue } from '../../node_modules/vue';
2
-
1
+ /// <reference types="@/shims-vue" />
2
+ /// <reference types="vue-i18n" />
3
+ import type { StyleValue } from '../../node_modules/vue';
3
4
  export interface BoxStyle {
4
5
  style: StyleValue;
5
6
  subClass?: string;
package/lib/i18n.ts CHANGED
@@ -1,16 +1,17 @@
1
- import { createI18n, I18n } from 'vue-i18n'
1
+ import { createI18n, I18n, I18nOptions } from 'vue-i18n'
2
2
 
3
3
  import fr from '@/locales/fr.json'
4
4
  import en from '@/locales/en.json'
5
5
 
6
6
  export const locale: string = 'en'
7
7
  export const fallbackLocale: string = 'en'
8
- // https://vue-i18n.intlify.dev/guide/advanced/composition.html#implicit-with-injected-properties-and-functions
9
- export const i18n: I18n = createI18n({
8
+ export const options: I18nOptions = {
10
9
  warnHtmlMessage: false,
10
+ // https://vue-i18n.intlify.dev/guide/advanced/composition.html#implicit-with-injected-properties-and-functions
11
11
  globalInjection: true,
12
12
  legacy: false,
13
13
  locale,
14
14
  fallbackLocale,
15
15
  messages: { fr, en }
16
- })
16
+ }
17
+ export const i18n: I18n = createI18n(options)
package/lib/main.ts CHANGED
@@ -4,7 +4,7 @@ import * as components from './components'
4
4
  import * as datavisualisations from './datavisualisations'
5
5
  import * as maps from './maps'
6
6
  import config from './config'
7
- import { App,Component,DefineComponent } from 'vue'
7
+ import { App,Component, DefineComponent } from 'vue'
8
8
 
9
9
  export { default as AccordionWrapper } from './components/AccordionWrapper.vue'
10
10
  export { default as AccordionStep } from './components/AccordionStep.vue'
@@ -48,6 +48,12 @@ export { default as SymbolMap } from './maps/SymbolMap.vue'
48
48
 
49
49
  type ComponentMap = {[name:string]:Component|DefineComponent}
50
50
 
51
+ type PluginOptions = {
52
+ useI18n?: boolean,
53
+ useBootstrap?: boolean,
54
+ useConfig?: boolean,
55
+ registerComponents?: boolean
56
+ }
51
57
 
52
58
  const Murmur = {
53
59
  get i18n() {
@@ -79,18 +85,37 @@ const Murmur = {
79
85
  // @ts-expect-error not sure why typescript sees an error here
80
86
  return Murmur.i18n.global.locale.value
81
87
  },
82
- install(app: App<Element>) {
83
- app.use(createBootstrap())
84
- app.use(i18n)
88
+ install(app: App<Element>, {
89
+ useI18n = true,
90
+ useBootstrap = true,
91
+ useConfig = true,
92
+ registerComponents = true
93
+ }: PluginOptions = {}) {
94
+
95
+ if (useBootstrap) {
96
+ app.use(createBootstrap())
97
+ }
98
+
99
+ if (useI18n) {
100
+ app.use(Murmur.i18n)
101
+ }
102
+
103
+ if (useConfig) {
104
+ app.config.globalProperties.$config = Murmur.config
105
+ }
85
106
 
86
- app.config.globalProperties.$config = Murmur.config
87
- Object.keys(this.components).forEach((key) =>
88
- app.component(key, this.components[key])
89
- )
90
- Object.keys(this.datavisualisations).forEach((key) =>
91
- app.component(key, this.datavisualisations[key])
92
- )
93
- Object.keys(this.maps).forEach((key) => app.component(key, this.maps[key]))
107
+ if (registerComponents) {
108
+ Object.keys(this.components).forEach((key) =>
109
+ app.component(key, this.components[key])
110
+ )
111
+ Object.keys(this.datavisualisations).forEach((key) =>
112
+ app.component(key, this.datavisualisations[key])
113
+ )
114
+ Object.keys(this.maps).forEach((key) =>
115
+ app.component(key, this.maps[key])
116
+ )
117
+ }
118
+
94
119
  }
95
120
  }
96
121
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icij/murmur-next",
3
- "version": "4.0.6",
3
+ "version": "4.0.8",
4
4
  "private": false,
5
5
  "description": "Murmur is ICIJ's Design System for Bootstrap 5 and Vue.js",
6
6
  "author": "promera@icij.org",