@atxm/identify
Advanced tools
Comparing version 0.2.5 to 0.3.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var developer_console_1 = require("@atxm/developer-console"); | ||
var console = new developer_console_1.default(); | ||
var meta = '@atxm/identify'; | ||
function initIDs() { | ||
var editors = atom.workspace.getTextEditors(); | ||
editors.map(function (editor) { return addEditorID(editor); }); | ||
var panes = atom.workspace.getPanes(); | ||
panes.map(function (pane) { return addPaneID(pane); }); | ||
atom.workspace.observeTextEditors(function (editor) { return addEditorID(editor); }); | ||
atom.workspace.observePanes(function (pane) { return addPaneID(pane); }); | ||
} | ||
function addEditorID(editor) { | ||
if (editor === null || editor === void 0 ? void 0 : editor.id) { | ||
var view = atom.views.getView(editor); | ||
var buffer = editor.buffer; | ||
if ((editor === null || editor === void 0 ? void 0 : editor.id) && !view.getAttribute('data-editor-id')) { | ||
console.log(meta + ": Add data-attribute for editor #" + editor.id); | ||
view.setAttribute('data-editor-id', editor.id); | ||
} | ||
if (buffer.id && !view.getAttribute('data-buffer-id')) { | ||
console.log(meta + ": Add data-attribute for buffer #" + buffer.id); | ||
view.setAttribute('data-buffer-id', buffer.id); | ||
} | ||
} | ||
} | ||
function addPaneID(pane) { | ||
if (pane === null || pane === void 0 ? void 0 : pane.id) { | ||
var view = atom.views.getView(pane); | ||
if (!view.getAttribute('data-pane-id')) { | ||
console.log(meta + ": Add data-attribute for pane #" + pane.id); | ||
view.setAttribute('data-pane-id', pane.id); | ||
} | ||
} | ||
} | ||
exports.default = initIDs; | ||
//# sourceMappingURL=index.js.map | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function t(t,o){for(var e=0,n=o.length,r=t.length;e<n;e++,r++)t[r]=o[e];return t}var o=new(function(){function o(t){void 0===t&&(t={}),this.name=t.name,this.styleSheet="\n background-color: "+(t.backgroundColor||"darkgrey")+";\n border-radius: 2px;\n color: "+(t.color||"white")+";\n line-height: 1.5;\n padding: 1px 4px;\n text-shadow: 0 1px 0px rgba(0, 0, 0, 0.2);\n "}return o.prototype.__console__=function(t){for(var o,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];(null===atom||void 0===atom?void 0:atom.inDevMode())&&(e.unshift("%c"+this.name+"%c",this.styleSheet,""),(o=window.console)[t].apply(o,e))},o.prototype.debug=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];this.__console__.apply(this,t(["debug"],o))},o.prototype.error=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];this.__console__.apply(this,t(["error"],o))},o.prototype.info=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];this.__console__.apply(this,t(["info"],o))},o.prototype.log=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];this.__console__.apply(this,t(["log"],o))},o.prototype.trace=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];this.__console__.apply(this,t(["trace"],o))},o.prototype.warn=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];this.__console__.apply(this,t(["warn"],o))},o}())({name:"@atxm/identify"});function e(t){if(null==t?void 0:t.id){var e=atom.views.getView(t),n=t.buffer;(null==t?void 0:t.id)&&!e.getAttribute("data-editor-id")&&(o.log("Add data-attribute for editor #"+t.id),e.setAttribute("data-editor-id",t.id)),n.id&&!e.getAttribute("data-buffer-id")&&(o.log("Add data-attribute for buffer #"+n.id),e.setAttribute("data-buffer-id",n.id))}}function n(t){if(null==t?void 0:t.id){var e=atom.views.getView(t);e.getAttribute("data-pane-id")||(o.log("Add data-attribute for pane #"+t.id),e.setAttribute("data-pane-id",t.id))}}module.exports=function(){atom.workspace.getTextEditors().map((function(t){return e(t)})),atom.workspace.getPanes().map((function(t){return n(t)})),atom.workspace.observeTextEditors((function(t){return e(t)})),atom.workspace.observePanes((function(t){return n(t)}))}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@atxm/identify", | ||
"version": "0.2.5", | ||
"version": "0.3.0", | ||
"description": "Adds data attributes for editor and pane IDs to the respective HTML element", | ||
"license": "MIT OR GPL-2.0", | ||
"scripts": { | ||
"build": "tsc --pretty --project ./", | ||
"dev": "tsc --watch --pretty --project ./", | ||
"lint": "tslint --project ./", | ||
"analyze": "source-map-explorer lib/**/*.js", | ||
"build": "rollup --config", | ||
"dev": "npm run start", | ||
"lint:code": "eslint --ignore-path .gitignore --no-error-on-unmatched-pattern ./src/**/*.ts", | ||
"lint:styles": "echo \"Nothing to lint\"", | ||
"lint": "npm-run-all --parallel lint:*", | ||
"prepublishOnly": "npm run build", | ||
"start": "rollup --watch --config", | ||
"test": "npm run lint" | ||
@@ -25,14 +30,39 @@ }, | ||
"devDependencies": { | ||
"@types/atom": "^1.36.2", | ||
"@types/node": "^14.14.41", | ||
"husky": ">=4 <5", | ||
"rimraf": "^3.0.2", | ||
"tslint": "^6.0.0", | ||
"typescript": "^3.7.5" | ||
"@babel/core": "^7.13.14", | ||
"@babel/eslint-parser": "^7.13.14", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.12.13", | ||
"@babel/preset-env": "^7.13.12", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^18.0.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^11.2.1", | ||
"@rollup/plugin-typescript": "^8.2.1", | ||
"@types/atom": "^1.40.10", | ||
"@types/electron": "^1.6.10", | ||
"@types/node": "^14.14.37", | ||
"@typescript-eslint/eslint-plugin": "^4.21.0", | ||
"@typescript-eslint/parser": "^4.21.0", | ||
"core-js": "^3.10.1", | ||
"eslint": "^7.23.0", | ||
"eslint-config-eslint": "^7.0.0", | ||
"eslint-plugin-json": "^2.1.2", | ||
"husky": ">=4.3 <5", | ||
"lint-staged": "^10.5.4", | ||
"npm-run-all": "^4.1.5", | ||
"rollup": "^2.44.0", | ||
"rollup-plugin-scss": "^2.6.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"source-map-explorer": "^2.5.2", | ||
"stylelint": "^13.12.0", | ||
"tslib": "^2.2.0", | ||
"typescript": "^4.2.4" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm run lint" | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.ts": "eslint --cache --fix" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
14603
98
28
6
2
0
2
1