Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atlaskit/adf-schema

Package Overview
Dependencies
Maintainers
1
Versions
407
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/adf-schema - npm Package Compare versions

Comparing version 1.4.3 to 1.4.4

5

CHANGELOG.md
# @atlaskit/adf-schema
## 1.4.4
- [patch] [adff2caed7](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/adff2caed7):
- Improve typings
## 1.4.3

@@ -4,0 +9,0 @@ - [patch] [d10cf50721](https://bitbucket.org/atlassian/atlaskit-mk-2/commits/d10cf50721):

4

dist/es2015/schema/create-schema.js

@@ -99,3 +99,3 @@ import * as tslib_1 from "tslib";

];
var marksInOrder = tslib_1.__spread([
var marksInOrder = [
{ name: 'link', spec: link },

@@ -115,3 +115,3 @@ { name: 'em', spec: em },

{ name: 'confluenceInlineComment', spec: confluenceInlineComment }
], markGroupDeclarations, [
].concat(markGroupDeclarations, [
{ name: 'breakout', spec: breakout },

@@ -118,0 +118,0 @@ { name: 'indentation', spec: indentation },

import * as nodes from './nodes';
export var inlineNodes = new Set(Object.keys(nodes).filter(function (key) { return nodes[key] && nodes[key].group === 'inline'; }));
var typedNodes = nodes;
export var inlineNodes = new Set(Object.keys(typedNodes).filter(function (key) { return typedNodes[key] && typedNodes[key].group === 'inline'; }));
//# sourceMappingURL=inline-nodes.js.map

@@ -31,3 +31,3 @@ import { MarkSpec, Mark } from 'prosemirror-model';

type: string;
attrs: {};
attrs: Record<string, string>;
};

@@ -1,2 +0,1 @@

import * as tslib_1 from "tslib";
import { COLOR } from '../groups';

@@ -24,3 +23,3 @@ import { rgbToHex, N90, Y500, T500, R500, P500, G500, N80, Y400, T300, R300, P300, G300, } from '../../utils/colors';

].forEach(function (_a) {
var _b = tslib_1.__read(_a, 2), color = _b[0], label = _b[1];
var color = _a[0], label = _a[1];
return colorPalette.set(color.toLowerCase(), label);

@@ -45,3 +44,5 @@ });

// else handle other colour formats
return colorPalette.has(hexColor) ? { color: hexColor } : false;
return hexColor && colorPalette.has(hexColor)
? { color: hexColor }
: false;
},

@@ -48,0 +49,0 @@ },

@@ -28,3 +28,3 @@ import { NodeSpec, Node as PMNode } from 'prosemirror-model';

export declare const toJSON: (node: PMNode<any>) => {
attrs: {};
attrs: Record<string, any>;
};

@@ -12,2 +12,3 @@ import { Fragment } from 'prosemirror-model';

}
return;
};

@@ -20,2 +21,3 @@ var extractLanguageFromClass = function (className) {

}
return;
};

@@ -22,0 +24,0 @@ var removeLastNewLine = function (dom) {

@@ -27,3 +27,5 @@ export var layoutColumn = {

toDOM: function (node) {
var attrs = { 'data-layout-column': 'true' };
var attrs = {
'data-layout-column': 'true',
};
var width = node.attrs.width;

@@ -30,0 +32,0 @@ if (width) {

@@ -37,3 +37,3 @@ import { NodeSpec, Node } from 'prosemirror-model';

export declare const toJSON: (node: Node<any>) => {
attrs: {};
attrs: any;
};

@@ -25,2 +25,3 @@ export var defaultAttrs = {

'data-layout': layout,
'data-width': '',
};

@@ -27,0 +28,0 @@ if (width) {

@@ -48,6 +48,6 @@ import { NodeSpec, Node as PMNode } from 'prosemirror-model';

export declare const media: NodeSpec;
export declare const camelCaseToKebabCase: (str: any) => any;
export declare const copyPrivateAttributes: (from: Object, to: Object, map?: ((string: any) => string) | undefined) => void;
export declare const camelCaseToKebabCase: (str: string) => string;
export declare const copyPrivateAttributes: (from: Record<string, any>, to: Record<string, any>, map?: ((str: string) => string) | undefined) => void;
export declare const toJSON: (node: PMNode<any>) => {
attrs: {};
attrs: Record<string, any>;
};

@@ -23,3 +23,5 @@ import { NodeSpec, Node as PMNode } from 'prosemirror-model';

export declare const toJSON: (node: PMNode<any>) => {
attrs: {};
attrs: {
[key: string]: any;
};
};

@@ -30,3 +30,3 @@ export var USER_TYPES;

if (USER_TYPES[userType]) {
attrs['userType'] = userType;
attrs.userType = userType;
}

@@ -33,0 +33,0 @@ return attrs;

@@ -7,2 +7,3 @@ import { Node as PmNode } from 'prosemirror-model';

style?: string | undefined;
'data-colwidth'?: string | undefined;
};

@@ -71,3 +72,5 @@ export declare const tableBackgroundColorPalette: Map<string, string>;

export declare const tableToJSON: (node: PmNode<any>) => {
attrs: {};
attrs: {
[key: string]: any;
};
};

@@ -114,6 +117,7 @@ export declare const tableRow: {

style?: string | undefined;
'data-colwidth'?: string | undefined;
})[];
};
export declare const toJSONTableCell: (node: PmNode<any>) => {
attrs: {};
attrs: Record<string, any>;
};

@@ -152,6 +156,7 @@ export declare const tableHeader: {

style?: string | undefined;
'data-colwidth'?: string | undefined;
})[];
};
export declare const toJSONTableHeader: (node: PmNode<any>) => {
attrs: {};
attrs: Record<string, any>;
};

@@ -1,2 +0,1 @@

import * as tslib_1 from "tslib";
import { hexToRgba, isHex, N20, B50, T50, P50, R50, G50, Y50, N0, B75, G75, R75, N40, P75, T75, Y75, } from '../../utils/colors';

@@ -76,3 +75,3 @@ var akEditorTableCellBackgroundOpacity = 0.5;

].forEach(function (_a) {
var _b = tslib_1.__read(_a, 2), colorValue = _b[0], colorName = _b[1];
var colorValue = _a[0], colorName = _a[1];
tableBackgroundColorPalette.set(colorValue.toLowerCase(), colorName);

@@ -84,3 +83,3 @@ tableBackgroundColorNames.set(colorName.toLowerCase(), colorValue.toLowerCase());

var isNumberColumnEnabled = node.attrs.isNumberColumnEnabled;
node.forEach(function (rowNode, _, i) {
node.forEach(function (rowNode, _) {
rowNode.forEach(function (colNode, _, j) {

@@ -87,0 +86,0 @@ var colwidth = colNode.attrs.colwidth || [0];

@@ -1,2 +0,1 @@

import * as tslib_1 from "tslib";
import * as namedColors from 'css-color-names';

@@ -119,3 +118,3 @@ /**

if (matches && matches.length >= 3) {
var _a = tslib_1.__read(matches.map(Number), 3), red = _a[0], green = _a[1], blue = _a[2];
var _a = matches.map(Number), red = _a[0], green = _a[1], blue = _a[2];
return ('#' +

@@ -122,0 +121,0 @@ (blue | (green << 8) | (red << 16) | (1 << 24)).toString(16).slice(1) // tslint:disable-line:no-bitwise

@@ -1,7 +0,41 @@

export declare function acNameToEmoji(acName: string): {
id: any;
shortName: any;
text: any;
/**
* Confluence glyphs ac:name of <ac:emoticon /> map to new emojis
* {
* [ac:name] : ['emoji-id', 'emoji-shortName', 'emoji-fallback']
* ...
* }
* Glyphs that do not map to Fabric Emoji
* will be mapped to Emoji Id '2b50' (:star:) with preserving ac:name as shortName attribute;
*/
declare const acNameToEmojiMap: {
smile: string[];
sad: string[];
cheeky: string[];
laugh: string[];
wink: string[];
information: string[];
tick: string[];
cross: string[];
warning: string[];
plus: string[];
minus: string[];
question: string[];
'thumbs-up': string[];
'thumbs-down': string[];
'light-on': string[];
'yellow-star': string[];
'light-off': string[];
'red-star': string[];
'green-star': string[];
'blue-star': string[];
heart: string[];
'broken-heart': string[];
};
export declare function emojiIdToAcName(emojiId: string): string;
export declare type NameToEmoji = keyof typeof acNameToEmojiMap;
export declare function acNameToEmoji(acName: NameToEmoji): {
id: string;
shortName: string;
text: string;
};
export declare function emojiIdToAcName(emojiId: string): never;
export declare function acShortcutToEmoji(hipchatEmoticonShortName: string): {

@@ -12,5 +46,6 @@ id: string;

};
export declare function getEmojiAcName({ id, shortName }: {
id: any;
shortName: any;
export declare function getEmojiAcName({ id, shortName, }: {
id: string;
shortName: string;
}): string;
export {};

@@ -7,4 +7,4 @@ export declare type Language = {

export declare function findMatchedLanguage(supportedLanguages: Language[], language?: string): Language | undefined;
export declare function filterSupportedLanguages(supportedLanguages: any): Language[];
export declare function filterSupportedLanguages(supportedLanguages: Array<string>): Language[];
export declare function getLanguageIdentifier(language: Language): string;
export declare function createLanguageList(supportedLanguages: Language[]): Language[];

@@ -11,3 +11,3 @@ export declare const isSafeUrl: (url: string) => boolean;

}
export declare function getLinkMatch(str: string): Match | null;
export declare function getLinkMatch(str: string): '' | Match | null;
/**

@@ -14,0 +14,0 @@ * Adds protocol to url if needed.

@@ -101,3 +101,3 @@ "use strict";

];
var marksInOrder = tslib_1.__spread([
var marksInOrder = [
{ name: 'link', spec: marks_1.link },

@@ -117,3 +117,3 @@ { name: 'em', spec: marks_1.em },

{ name: 'confluenceInlineComment', spec: marks_1.confluenceInlineComment }
], markGroupDeclarations, [
].concat(markGroupDeclarations, [
{ name: 'breakout', spec: marks_1.breakout },

@@ -120,0 +120,0 @@ { name: 'indentation', spec: marks_1.indentation },

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var nodes = require("./nodes");
exports.inlineNodes = new Set(Object.keys(nodes).filter(function (key) { return nodes[key] && nodes[key].group === 'inline'; }));
var typedNodes = nodes;
exports.inlineNodes = new Set(Object.keys(typedNodes).filter(function (key) { return typedNodes[key] && typedNodes[key].group === 'inline'; }));
//# sourceMappingURL=inline-nodes.js.map

@@ -31,3 +31,3 @@ import { MarkSpec, Mark } from 'prosemirror-model';

type: string;
attrs: {};
attrs: Record<string, string>;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var groups_1 = require("../groups");

@@ -26,3 +25,3 @@ var colors_1 = require("../../utils/colors");

].forEach(function (_a) {
var _b = tslib_1.__read(_a, 2), color = _b[0], label = _b[1];
var color = _a[0], label = _a[1];
return exports.colorPalette.set(color.toLowerCase(), label);

@@ -47,3 +46,5 @@ });

// else handle other colour formats
return exports.colorPalette.has(hexColor) ? { color: hexColor } : false;
return hexColor && exports.colorPalette.has(hexColor)
? { color: hexColor }
: false;
},

@@ -50,0 +51,0 @@ },

@@ -28,3 +28,3 @@ import { NodeSpec, Node as PMNode } from 'prosemirror-model';

export declare const toJSON: (node: PMNode<any>) => {
attrs: {};
attrs: Record<string, any>;
};

@@ -14,2 +14,3 @@ "use strict";

}
return;
};

@@ -22,2 +23,3 @@ var extractLanguageFromClass = function (className) {

}
return;
};

@@ -24,0 +26,0 @@ var removeLastNewLine = function (dom) {

@@ -29,3 +29,5 @@ "use strict";

toDOM: function (node) {
var attrs = { 'data-layout-column': 'true' };
var attrs = {
'data-layout-column': 'true',
};
var width = node.attrs.width;

@@ -32,0 +34,0 @@ if (width) {

@@ -37,3 +37,3 @@ import { NodeSpec, Node } from 'prosemirror-model';

export declare const toJSON: (node: Node<any>) => {
attrs: {};
attrs: any;
};

@@ -27,2 +27,3 @@ "use strict";

'data-layout': layout,
'data-width': '',
};

@@ -29,0 +30,0 @@ if (width) {

@@ -48,6 +48,6 @@ import { NodeSpec, Node as PMNode } from 'prosemirror-model';

export declare const media: NodeSpec;
export declare const camelCaseToKebabCase: (str: any) => any;
export declare const copyPrivateAttributes: (from: Object, to: Object, map?: ((string: any) => string) | undefined) => void;
export declare const camelCaseToKebabCase: (str: string) => string;
export declare const copyPrivateAttributes: (from: Record<string, any>, to: Record<string, any>, map?: ((str: string) => string) | undefined) => void;
export declare const toJSON: (node: PMNode<any>) => {
attrs: {};
attrs: Record<string, any>;
};

@@ -23,3 +23,5 @@ import { NodeSpec, Node as PMNode } from 'prosemirror-model';

export declare const toJSON: (node: PMNode<any>) => {
attrs: {};
attrs: {
[key: string]: any;
};
};

@@ -32,3 +32,3 @@ "use strict";

if (USER_TYPES[userType]) {
attrs['userType'] = userType;
attrs.userType = userType;
}

@@ -35,0 +35,0 @@ return attrs;

@@ -7,2 +7,3 @@ import { Node as PmNode } from 'prosemirror-model';

style?: string | undefined;
'data-colwidth'?: string | undefined;
};

@@ -71,3 +72,5 @@ export declare const tableBackgroundColorPalette: Map<string, string>;

export declare const tableToJSON: (node: PmNode<any>) => {
attrs: {};
attrs: {
[key: string]: any;
};
};

@@ -114,6 +117,7 @@ export declare const tableRow: {

style?: string | undefined;
'data-colwidth'?: string | undefined;
})[];
};
export declare const toJSONTableCell: (node: PmNode<any>) => {
attrs: {};
attrs: Record<string, any>;
};

@@ -152,6 +156,7 @@ export declare const tableHeader: {

style?: string | undefined;
'data-colwidth'?: string | undefined;
})[];
};
export declare const toJSONTableHeader: (node: PmNode<any>) => {
attrs: {};
attrs: Record<string, any>;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var colors_1 = require("../../utils/colors");

@@ -78,3 +77,3 @@ var akEditorTableCellBackgroundOpacity = 0.5;

].forEach(function (_a) {
var _b = tslib_1.__read(_a, 2), colorValue = _b[0], colorName = _b[1];
var colorValue = _a[0], colorName = _a[1];
exports.tableBackgroundColorPalette.set(colorValue.toLowerCase(), colorName);

@@ -86,3 +85,3 @@ exports.tableBackgroundColorNames.set(colorName.toLowerCase(), colorValue.toLowerCase());

var isNumberColumnEnabled = node.attrs.isNumberColumnEnabled;
node.forEach(function (rowNode, _, i) {
node.forEach(function (rowNode, _) {
rowNode.forEach(function (colNode, _, j) {

@@ -89,0 +88,0 @@ var colwidth = colNode.attrs.colwidth || [0];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var namedColors = require("css-color-names");

@@ -124,3 +123,3 @@ /**

if (matches && matches.length >= 3) {
var _a = tslib_1.__read(matches.map(Number), 3), red = _a[0], green = _a[1], blue = _a[2];
var _a = matches.map(Number), red = _a[0], green = _a[1], blue = _a[2];
return ('#' +

@@ -127,0 +126,0 @@ (blue | (green << 8) | (red << 16) | (1 << 24)).toString(16).slice(1) // tslint:disable-line:no-bitwise

@@ -1,7 +0,41 @@

export declare function acNameToEmoji(acName: string): {
id: any;
shortName: any;
text: any;
/**
* Confluence glyphs ac:name of <ac:emoticon /> map to new emojis
* {
* [ac:name] : ['emoji-id', 'emoji-shortName', 'emoji-fallback']
* ...
* }
* Glyphs that do not map to Fabric Emoji
* will be mapped to Emoji Id '2b50' (:star:) with preserving ac:name as shortName attribute;
*/
declare const acNameToEmojiMap: {
smile: string[];
sad: string[];
cheeky: string[];
laugh: string[];
wink: string[];
information: string[];
tick: string[];
cross: string[];
warning: string[];
plus: string[];
minus: string[];
question: string[];
'thumbs-up': string[];
'thumbs-down': string[];
'light-on': string[];
'yellow-star': string[];
'light-off': string[];
'red-star': string[];
'green-star': string[];
'blue-star': string[];
heart: string[];
'broken-heart': string[];
};
export declare function emojiIdToAcName(emojiId: string): string;
export declare type NameToEmoji = keyof typeof acNameToEmojiMap;
export declare function acNameToEmoji(acName: NameToEmoji): {
id: string;
shortName: string;
text: string;
};
export declare function emojiIdToAcName(emojiId: string): never;
export declare function acShortcutToEmoji(hipchatEmoticonShortName: string): {

@@ -12,5 +46,6 @@ id: string;

};
export declare function getEmojiAcName({ id, shortName }: {
id: any;
shortName: any;
export declare function getEmojiAcName({ id, shortName, }: {
id: string;
shortName: string;
}): string;
export {};

@@ -7,4 +7,4 @@ export declare type Language = {

export declare function findMatchedLanguage(supportedLanguages: Language[], language?: string): Language | undefined;
export declare function filterSupportedLanguages(supportedLanguages: any): Language[];
export declare function filterSupportedLanguages(supportedLanguages: Array<string>): Language[];
export declare function getLanguageIdentifier(language: Language): string;
export declare function createLanguageList(supportedLanguages: Language[]): Language[];

@@ -11,3 +11,3 @@ export declare const isSafeUrl: (url: string) => boolean;

}
export declare function getLinkMatch(str: string): Match | null;
export declare function getLinkMatch(str: string): '' | Match | null;
/**

@@ -14,0 +14,0 @@ * Adds protocol to url if needed.

{
"name": "@atlaskit/adf-schema",
"version": "1.4.3",
"version": "1.4.4",
"sideEffects": false
}
{
"name": "@atlaskit/adf-schema",
"version": "1.4.3",
"version": "1.4.4",
"description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",

@@ -30,2 +30,3 @@ "license": "Apache-2.0",

"dependencies": {
"@types/linkify-it": "^2.0.4",
"@types/prosemirror-model": "^1.5.0",

@@ -32,0 +33,0 @@ "@types/prosemirror-state": "^1.2.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc